Skip to content

Instantly share code, notes, and snippets.

@gc-garcol
Last active July 1, 2024 04:16
Show Gist options
  • Save gc-garcol/ecfd3541cd3015f4554c3cf0052c79e7 to your computer and use it in GitHub Desktop.
Save gc-garcol/ecfd3541cd3015f4554c3cf0052c79e7 to your computer and use it in GitHub Desktop.
LMAX disruptor

Lmax disruptor

lmax architecture

Example

    public void onEvent(CommandBufferEvent event, long sequence, boolean endOfBatch) throws Exception {
        pushToBuffers(event);
        if (endOfBatch) {
            journalCommandLogs();
        }
    }

Note: on each duty circle, processor batching-consumes the messages from next-of-last-consumed slot to the endOfBatch slot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment