Skip to content
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

Push Task to Ordered Set #36

Closed
wants to merge 2 commits into from

Conversation

nsteinberg-r7
Copy link
Contributor

@nsteinberg-r7 nsteinberg-r7 commented May 20, 2021

Description:
enable pushing tasks to ordered sets, to ensure avoiding duplication in queue.
I see this is how the delayed tasks feature is implemented, it could be helpful to have it also as a normal push_task.

@wavenator
Copy link
Contributor

Your implementation won't work, and it won't work by design.
The reason it won't work is that inside each task there is a date parameter of type float, which will make tasks with the same kwargs different in their serialized representation. The only way to avoid duplication is to not create them in the first place. We are not going to work with a Redis zset as it poses other issues that we are not willing to solve. Tasks will lose their order is a set which will be set according to the data hashed representation according to Redis implementation. Zset is also much slower than lists. I'm closing this PR for the aforementioned reasons. If you would like to open a discussion about this feature feel free to open an issue where we will think about the implications and the appropriate design.

Cheers

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.

None yet

2 participants