Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve blocking tasks #53

Merged
merged 1 commit into from
Jul 27, 2022
Merged

Improve blocking tasks #53

merged 1 commit into from
Jul 27, 2022

Conversation

crodas
Copy link
Owner

@crodas crodas commented Jul 23, 2022

Introduce a generic way to spawn blocking tasks, adding an optional
timeout option and a retry mechanism.

The spawned task will subscribe to a set of keys and will be awaken
everytime the data version changes in any of the watched keys. The
worker function will return true or false, false meaning they want to be
rescheduled again.

This mechanism will improve CPU usage on current approach which is
sleep/retry every few milliseconds, which is suboptimal to say the
least.

Fixes #52

@crodas crodas force-pushed the feature/52-improve-blocking-tasks branch 6 times, most recently from cffc42b to c0285bc Compare July 27, 2022 17:48
@crodas crodas changed the title WIP: Improve blocking tasks Improve blocking tasks Jul 27, 2022
@crodas crodas force-pushed the feature/52-improve-blocking-tasks branch 2 times, most recently from 83e8aad to c184baf Compare July 27, 2022 18:06
Introduce a generic way to spawn blocking tasks, adding an optional
timeout option and a retry mechanism.

The spawned task will subscribe to a set of keys and will be awaken
everytime the data version changes in any of the watched keys. The
worker function will return true or false, false meaning they want to be
rescheduled again.

This mechanism will improve CPU usage on current approach which is
sleep/retry every few milliseconds, which is suboptimal to say the
least.
@crodas crodas force-pushed the feature/52-improve-blocking-tasks branch from c184baf to 01307d3 Compare July 27, 2022 18:12
@crodas crodas merged commit 4a79d00 into main Jul 27, 2022
@crodas crodas deleted the feature/52-improve-blocking-tasks branch July 27, 2022 18:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve internals for blocked tasks/commands.
1 participant