iluwatar / iluwatar/java-design-patterns

Disruptor Pattern

Open
#112 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

epic: pattern info: help wanted type: feature
Dominant language
Java
Stars
94.7k
Forks
27.4k
Avg merge
3d 4h
Merged PRs (30d)
10

Description

Description:
The Disruptor is a high-performance inter-thread messaging library. It provides a way to achieve high throughput and low latency in message processing systems. The main elements of the Disruptor pattern include:

  1. Ring Buffer: A pre-allocated circular buffer that holds the data to be processed. The ring buffer is the core of the Disruptor, allowing for efficient memory allocation and access.
  2. Event Processors: Components that consume events from the ring buffer. They can be set up in different configurations such as single, multiple, or parallel consumers.
  3. Sequencers: Components that control the order of events being processed. They ensure that events are processed in the correct sequence and manage dependencies between different event processors.
  4. Producers: Components that publish events to the ring buffer. Producers write data to the ring buffer, which is then consumed by the event processors.
  5. Wait Strategies: Strategies that determine how consumers wait for events to be available in the ring buffer. Different strategies can be used to balance between CPU usage and latency.

References:

  1. Disruptor Pattern Wikipedia
  2. LMAX Disruptor: High Performance Inter-thread Messaging Library
  3. Martin Fowler on LMAX Architecture

Acceptance Criteria:

  1. Implement a ring buffer with configurable size to hold the events.
  2. Develop event processors that consume events from the ring buffer, supporting different processing configurations.
  3. Ensure proper sequencing of events using a sequencer component.
  4. Implement producers that can publish events to the ring buffer efficiently.
  5. Include at least one wait strategy for managing how consumers wait for events.

Please refer to the project contribution guidelines before submitting your pull request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked project contribution guidelines and the Disruptor and LMAX references to understand the requested pattern. The work is complete when the acceptance criteria are met: configurable ring buffer, event processors, sequencing, efficient producers, and at least one wait strategy.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.