Requested Actor behavior: receiveWithin(atimeout) functionality
!! presumes the current actor is waiting for a future receipt of a message in response to sending a message to another actor.
Sometimes though we need functionality that simply waits for any message to arrive within a timeframe. This design pattern is common in (business) process design where a 'port' is opened waiting for any of a given set of messages from a peer actor. These messages may be 'out of the blue'/not explicitly solicited. An example is in an RFQ/QUOTE negotiation scenario a seller may send RequestForClarification messages to the buyer. These messages can be sent out of the blue to the seller during the negotiation window that is time-boxed. During this timebox a receiveUntil would be used to accept RFCs, QUOTEs, etc. We continue to chain back to the receiveUntil on the seller side while the negotiation time window is open.
Sometimes though we need functionality that simply waits for any message to arrive within a timeframe. This design pattern is common in (business) process design where a 'port' is opened waiting for any of a given set of messages from a peer actor. These messages may be 'out of the blue'/not explicitly solicited. An example is in an RFQ/QUOTE negotiation scenario a seller may send RequestForClarification messages to the buyer. These messages can be sent out of the blue to the seller during the negotiation window that is time-boxed. During this timebox a receiveUntil would be used to accept RFCs, QUOTEs, etc. We continue to chain back to the receiveUntil on the seller side while the negotiation time window is open.
Leave a comment
Can use Scheduler