Create a new ClosablePriorityQueue#4
Conversation
simonschmidt
left a comment
There was a problem hiding this comment.
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.
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.