iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
88.66k stars 26.28k forks source link

Proactor pattern #78

Open iluwatar opened 9 years ago

iluwatar commented 9 years ago

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.
Sea-Sheep commented 3 years ago

I just add them according to the document in the Internet @iluwatar and pr :)

ohbus commented 3 years ago

⭐ Sure thing! Thanks for your interest in our project 😃

iluwatar commented 2 years ago

Please indicate if you are still working on this issue @Sea-Sheep

Sea-Sheep commented 2 years ago

have updated the pr for the latest code @iluwatar

iluwatar commented 2 months ago

Updated task description