iluwatar / iluwatar/java-design-patterns

Proactor pattern

Open
#78 7 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 Proactor design pattern is an asynchronous programming pattern used to efficiently handle multiple concurrent operations. In this pattern, the application initiates asynchronous operations and a separate handler (the Proactor) deals with the completion of these operations. The Proactor pattern is useful in scenarios where the system needs to handle a high number of I/O operations, such as in network servers and high-performance computing applications.

Main Elements of Proactor Pattern:

  1. Initiator: The component that initiates asynchronous operations.
  2. Asynchronous Operation: The operations that are performed asynchronously, often related to I/O tasks.
  3. Completion Handler: A callback or handler that is invoked when the asynchronous operation is complete.
  4. Proactor: The dispatcher that manages the completion of asynchronous operations and invokes the appropriate handlers.
  5. Operation Result: The data or result obtained after the completion of the asynchronous operation.

References:

  1. Proactor Design Pattern - Wikipedia
  2. Asynchronous I/O - Proactor Pattern

Acceptance Criteria:

  1. The implementation should include a clear separation of the main elements: Initiator, Asynchronous Operation, Completion Handler, and Proactor.
  2. A working example demonstrating the Proactor pattern in a real-world scenario, such as a network server handling multiple simultaneous connections.
  3. Comprehensive unit tests to verify the correct behavior of each component in the pattern, ensuring robustness and reliability.

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

The issue names no target files, entry points, or existing tests in the java-design-patterns repository. Start by reviewing the repository's existing Java pattern implementations and test structure, then define the Initiator, asynchronous operation, Completion Handler, Proactor, and operation result around the network-server example. Done means the example works for simultaneous connections and unit tests cover each component.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.