moonlibs / xqueue

Imbue tarantool space with power of queue
15 stars 12 forks source link

Support priorities for tasks #10

Closed ochaton closed 2 years ago

ochaton commented 5 years ago

xqueue allows passing field priority to upgrade method but totally ignores it when consumer takes tasks.

The idea is to give an opportunity for developers to upgrade Tarantool space to priority queue adding field priority into schema of space and use status_priority_id index instead of status_id for take method.

xqueue.upgrade must validate that index status_priority_id created correctly if priority option is given.

priority supposed to be an integer number. The greater priority the later task will be taken from the queue.

ochaton commented 2 years ago

already implemented https://github.com/moonlibs/xqueue/commit/fb58ed249c6aaedcbab586dc5fce476e53fe8215