ParallelConversationWorkQueue
This implementation of ConversationWorkQueue allows parallel work between conversations, but only one simultaneous work per conversation, i.e. each conversation has its own parallel queue.
If work is being performed for a conversation, allows enqueuing up to one extra work to be done afterward. When attempting to enqueue multiple works for the same ConversationTimeEventInput.conversationId, only the work with most recent ConversationTimeEventInput.eventTime parameter will be scheduled.
This is aimed at things like handling Delivery or Read Receipts. For Read Receipts, for example, the user may navigate to an unread conversation, and the client might want to mark as read multiple times in a row as the user scrolls through the unread messages. This queue solves it by making sure only one event for that conversation is handled at a time, and if multiple calls are made in rapid succession while one operation is ongoing, only the most recent one will actually be scheduled to be performed.
Constructors
Functions
Enqueues new work parameters for the provided input. Will only emit a new entry / replacing an existing one for the ConversationTimeEventInput.conversationId if the ConversationTimeEventInput.eventTime is more recent than the existing one. If there's an existing work being done for the same ConversationTimeEventInput.conversationId, it will wait until it's over. After that, will start working as soon as the dispatcher allows it, while the scope is alive.