-
Notifications
You must be signed in to change notification settings - Fork 2
Create a new ClosablePriorityQueue #4
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
base: master
Are you sure you want to change the base?
Conversation
simonschmidt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pull request! :)
tests/test_closablequeue.py
Outdated
| randomized = ordered.copy() | ||
| random.shuffle(randomized) | ||
| cpq = ClosablePriorityQueue(fuzz=0.01) | ||
| for letter in ordered: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be for letter in randomized right?
|
Though I think you wont achieve your end goal with this, as the priority queue can at best give you partial ordering as it will probably be read from while it is still being written to. However to create a collecting and sorting stage you could create a worker like: And make sure to run it with On a related note, I've found it useful to limit the size of the output queue of workers to avoid pile-up in early quick parts of the chain, I should probably change the default to be something like |
Rename join to joinall to match gevent
|
@simonschmidt I had the same thought.... my approach was going to be either to make sure the CPQ was used as the last stage and then start a new Pipeline with that as the initial input, or... as I showed here, make join (or joinall, whatever) act like the rest of the methods and return |
|
Not sure about that approach, you would also need to restart the I added a I'd still like to have the |
|
With regards to One thing I like about using the I'm all for having |
This allows ordering in stages of the pipeline. My idea was to use this with Pipeline.join() to in effect create a bottleneck pipeline stage that forces sequential ordering and then releases to further stages.