-
Notifications
You must be signed in to change notification settings - Fork 1
APIs
-
As to 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.
-
As to 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.
The length of the queue
Indicate how many members to pop
-
As to queue/stack, the return value is a list whose length is less then or equal
count
. -
As to priority queue, the return value is a list composed of tuples and each tuple holds a (member, score) pair.
Compatible with queue/stack.
The member would be pushed into the queue only if it was not already inside.
Compatible with priority queue.
The member would be pushed into the queue only if it was not already inside.
Getting the index of the member.
-
As to queue/stack/deque, it returns the index of the member with 0-base. If the member not found, None would be returned.
-
As to priority queue, it returns 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.
-
As to queue/stack/deque,
start
andend
should be compatible with Redis::LRANGE -
As to priority queue,
start
andend
should be compatible with Redis::ZRANGE
-
As to queue/stack/deque, a list composed of members.
-
As to 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.