How to add a constraint on the item ? #220
Answered
by
gustavolabbate
gustavolabbate
asked this question in
Q&A
-
There is a way to add some constraints on the item added? For instance, if I added 'a', I dont want to add 'a' again... |
Beta Was this translation helpful? Give feedback.
Answered by
gustavolabbate
Sep 30, 2024
Replies: 1 comment
-
I´ve got it.. If someone need to know, UniqueAckQ do the trick.. My test example: uq = persistqueue.UniqueAckQ('pathuq') When ack the item, it change to status 5 The put code : uq = persistqueue.UniqueAckQ('pathuq') When the queue is empty, with all items in status 5, get will wait for another item. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
peter-wangxu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I´ve got it..
If someone need to know, UniqueAckQ do the trick..
My test example:
uq = persistqueue.UniqueAckQ('pathuq')
item = uq.get(raw=True)
print(item)
uq.ack(item)
When ack the item, it change to status 5
The put code :
uq = persistqueue.UniqueAckQ('pathuq')
uq.put(item)
When the queue is empty, with all items in status 5, get will wait for another item.