-
Notifications
You must be signed in to change notification settings - Fork 536
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
QSCAN command proposal #56
Comments
What do you think about removing the |
We can change name, for example
However I believe |
Makes sense! In any case, if you're writing a tool for Disque you'll have to err on the safe side and use the iterator. Client libraries will probably offer a utility method to iterate automatically and the built-in |
Yep I agree
|
Designed in the context of issue #56.
Ok now we have an implementation of it as specified in this issue, please check the |
Can I be the devil's advocate and say even with those two use cases I don't think |
@mariano currently what we did is to provide as a default interface the sane one, as an alternative interface a broken one but with a decent use case. If people will decide to shoot themselves in the feet, at this point they can, but they'll very likely know what they are doing... However not having such an interface makes me worring that 99% of people having 10 or 20 queues or alike, will not have a trivial way to write a shell script or something like that. So I agree with you that the infinite lazyness of programmers makes us at risk of misuse, but at the same time we can actively write in the doc what we think about this, and the name itself is pretty self-describing... anyway currently other misuses are possible. For example |
@antirez makes sense |
Designed in the context of issue #56.
Merged and documented into README. |
QSCAN [COUNT <count>] [BLOCKING] [MINLEN <len>] [MAXLEN <len>] [IMPORTRATE <rate>]
This issue is a proposal for a queue iteration command for Disque, able to enlist al the existing queues names, and providing filter capabilities to only enlist a subset of the existing queues. The command is non blocking, and is very similar to Redis
SCAN
commands, providing a cursor based non blocking iterator that guarantees to return all the elements but may emit duplicates. Contrary to Redis a blocking option is provided for blocking, unique elements output semantics, because there are a great deal of use cases where the number of queues is small.The command returns an iterator and a list of elements. We could set the default
COUNT
to a large value like ~100, in order for most use cases dealing with a few queues to get all the queue names with just a singleQSCAN
invocation, without any argument at all.Options:
<count>
Only return queues having at least (>=) count enqueued jobs.<count>
Only return queues having at most (<=) count enqueued jobs.<msgsec>
Only return queues importing at least msgsec messages per second from other nodes. If zero is specified all the queues importing a non-zero number of messages are returned.<count>
Perform count work at every iteration. Does not always map to the actual number of returned items like in Redis.Please give some feedback. It's pretty trivial to implement but I don't want to write code straight away.
The text was updated successfully, but these errors were encountered: