-
Notifications
You must be signed in to change notification settings - Fork 1
APIs
- queue/stack: The parameter should be a str or an int when intend to push single member, otherwise it should be a list or a tuple.
- priority queue: the parameter should be a dict which holds one or more members. In the dict, the key is member and the value is score of the member. Notice that, the score should be an int.
- queue/stack/priority queue: length of the queue
- capped queue/stack/priority queue: error code if the queue was full or lacked of positions, else length of the queue
- overflow-able capped queue: a list like [length, [m1, m2]] contains length of the queue and the members been pushed out.
- overflow-able capped priority queue: a list like [length, [(m1,s1),(m2,s2)]] contains length of the queue and the overflowed members been pushed out with their scores.
How many members to pop
-
queue/stack: a list contains the members been pop.
-
priority queue: a list composed of tuples and each tuple holds a (member, score) pair.
- deque: same to queue/stack except that the members are pushed into from the front end.
- capped deque: same to capped queue except that the members are pushed into from the front end.
- overflow-able capped deque: same to overflow-able capped queue except that the members are pushed into from the front end and the overflowed members are pushed out from the back end.
- deque: same to queue/stack
- capped deque: same to capped queue
- overflow-able capped deque: same to overflow-able capped queue
The member would be pushed into the queue only if it was not already inside.
- queue/stack: a list like [int, bool] contains length of queue and a bool which indicates the member been pushed into or not.
- capped queue/stack: error code if the queue was full or lacked of positions, otherwise the same to queue/stack.
- overflow-able queue: a list like [int, list, bool], similar to push of overflow-able queue except that the bool indicates the member been pushed into or not.
The member would be pushed into the queue only if it was not already inside.
- priority queue: a list like [int, bool] contains length of queue and a flag which indicates the member been pushed into or not.
- capped priority queue: error code if the queue was full or lacked of positions, otherwise the same to priority queue.
- overflow-able priority queue: a list like [int, list, bool], similar to push of overflow-able priority queue except that the bool indicates the member been pushed into or not.
Getting the index of the member.
-
queue/stack/deque: the index of the member with 0-base. If the member not found, None would be returned.
-
priority queue: the rank of the member with 0-base. If the member not found, None would be returned.
Should be a list or a tuple.
A dict whose keys are members and values are their indexes.
-
queue/stack/deque:
start
andend
should be compatible with Redis::LRANGE -
priority queue:
start
andend
should be compatible with Redis::ZRANGE
-
queue/stack/deque: a list composed of members.
-
prority queue: a list composed of tuples and each tuple holds a (member, score) pair.
Return the length of the queue.
Destruct the queue and the Redis item would be deleted.
The parameter(s) would be passed transparently to Redis client behind the scene.