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

Collector State Pattern

Open npathai opened this issue 8 years ago • 12 comments

http://www.eventhelix.com/RealtimeMantra/PatternCatalog/CollectorStatePattern.htm

Realtime software sometimes involves collecting a sequence of messages. Further action can be initiated only after complete sequence of messages has been received. Collector state pattern handles such scenarios.

Intent

The main intention here is to manage sequence of events of same type. For example, a Call object needs to collect all the digits to perform call routing. This will involve activities like a timer start before each digit, digit collection, timer stop at each digit collection, timeout on complete digit collection and call routing on complete digit collection.

Also Known As

Digit Collection Design Pattern Message Assembly Design Pattern

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]