Events with the same eventType and swimlane MUST BE processed sequentially. All other events can and should be processed concurrently.
In the Java code, SwimlaneBasedDispatcher.java maintains a separate queue of events for each swimlane (BUG it should be eventType and swimlane). A thread based mechanism pulls events from the queue and processes them one at a time. NodeJS doesn’t have threads but I’d imagine a callback-based messaging would be good:
When the processing of one message completes, get the next message from the queue if there is one
Each queue keeps track of whether processing is happening so that after adding an event to the queue:
If not processing, start processing
If processing, do nothing - event will be processed eventually
Events with the same eventType and swimlane MUST BE processed sequentially. All other events can and should be processed concurrently.
In the Java code, SwimlaneBasedDispatcher.java maintains a separate queue of events for each swimlane (BUG it should be eventType and swimlane). A thread based mechanism pulls events from the queue and processes them one at a time. NodeJS doesn’t have threads but I’d imagine a callback-based messaging would be good: