unionlabs/union

add priority to queue-msg

Opened this issue · 0 comments

currently with the Op::Defer message, we spin on it until it's passed. this is quite inefficient since it can block out other messages that are more important (i.e. literally anything else other than waiting for a timestamp). we should integrate this functionality directly into the queue, such that the messages also have an optional "don't pull until" column, with Op::Defer being the "gateway" to this column. if a defer message is hit, the queue will push this back into the queue with the "don't pull until" column set to the timestamp to wait for, and then when pulling new items from the queue it will only pull items where the "don't pull until" column is <= now().

todo: wtf to call this column