java-design-patterns icon indicating copy to clipboard operation
java-design-patterns copied to clipboard

Collector State Pattern

Open npathai opened this issue 9 years ago • 15 comments

Description: The Collector State design pattern is a behavioral design pattern used in real-time software to manage scenarios where a sequence of messages needs to be collected before initiating further actions. Key elements include:

  • Collected Message Handler: Receives and processes messages, starts and stops timers, and decides when the collection is complete.
  • Timeout Handler: Manages timeout events, determining the status of the collection (success or failure).

This pattern is particularly useful in situations like digit collection for call routing, where messages are collected and processed based on specific conditions and timeouts.

References:

Acceptance Criteria:

  1. Implement the basic structure of the Collector State design pattern, including the Collected Message Handler and Timeout Handler.
  2. Provide a working example demonstrating the usage of the Collector State pattern with unit tests to ensure functionality.
  3. Ensure the implementation adheres to the project's contribution guidelines as outlined in the java-design-patterns wiki.

npathai avatar Mar 02 '16 08:03 npathai

I guess, I can do this. What is the deadline then? I usually have 2 hr free time per day.

zhexuany avatar Mar 17 '16 17:03 zhexuany

@zhexuany there are no deadlines. Take your time and create a pull request when you're ready for review. Let us know if you need help via this issue or Gitter.

iluwatar avatar Mar 17 '16 19:03 iluwatar

@iluwatar Nice. I will work on this issue when I am free. ;)

zhexuany avatar Mar 18 '16 20:03 zhexuany

@zhexuany are you making progress?

iluwatar avatar Jul 14 '16 09:07 iluwatar

This issue is free for taking again.

iluwatar avatar Sep 25 '16 17:09 iluwatar

Hey, @iluwatar looks like nobody commented to take this issue up.

But I can see that @Mediocrity7 started working on this thing, and @Laurels7 has already submitted a PR #1769 for this, what should we be doing?

ohbus avatar May 22 '21 04:05 ohbus

To me, it seems the consensus is that we should review the PR made by @Laurels7 here https://github.com/iluwatar/java-design-patterns/pull/1769

iluwatar avatar May 31 '21 19:05 iluwatar

Updated link to the pattern description: https://www.eventhelix.com/design-patterns/collector-state/

iluwatar avatar Jun 01 '21 18:06 iluwatar

Hi, may I attempt to get this working? It will take a little time though.

DoopTheSoup avatar Oct 07 '22 00:10 DoopTheSoup

@iluwatar I was looking through the past progress of this issue, and was wondering if I could get an elaboration on what you meant by "threaded messages that sends multiple stateless messages" - https://github.com/iluwatar/java-design-patterns/pull/1769/commits/1324c0d0753f1af0a816172c4eb847cad2f8c4b1#r643438460

DoopTheSoup avatar Oct 16 '22 08:10 DoopTheSoup

@DoopTheSoup the message passing mechanism is one of the core parts of this pattern. I think there should be the sender and the message collector components. I suggest that you take a look how this has been implemented in producer-consumer pattern.

iluwatar avatar Oct 16 '22 15:10 iluwatar

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 28 '22 14:11 stale[bot]