Skip to content

refactor: Swap Redis PubSub for Celery AsyncResult and custom states #228

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Sep 26, 2022

Conversation

in03
Copy link
Owner

@in03 in03 commented Sep 26, 2022

No description provided.

in03 added 17 commits September 6, 2022 03:20
…into feature/issue-224-Revisit-Redis-PubSub
Now just calculating progress and task info every iteration of the loop
instead of checking new data flags. It looks like there may be a race
condition of some sort causing inaccurate worker numbers.

I might consider thread locks if they work with Redis' pubsub run_in_thread.
Alright, this is kind of funny. Turns out I've been reinventing the wheel
this whole time. Celery's GroupResult contains AsyncResult instances with
all the data we need to get active worker count, task completion and
task encoding progress (with a custom task state definition).

So:
- dropped Redis database polling
- dropped Redis PubSub
- use unique worker IDs instead of sequential prefix to easily start
additional workers at any time
@in03 in03 merged commit 92f1747 into main Sep 26, 2022
@in03 in03 deleted the feature/issue-224-Revisit-Redis-PubSub branch September 26, 2022 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant