When to use throw/catch events and send/receive tasks
The following table is a quick guide to which kind of inter-process communication mechanism you should use in various circumstances:
Throw/catch message events |
Throw/catch signal events |
Send/receive tasks | |
---|---|---|---|
Ability to attach a boundary event to catch errors |
No |
No |
Yes |
Asynchronous |
Either |
Yes |
Yes |
Invoked process becomes a ... |
Child |
Child |
Peer |
The process you want to invoke starts with a ... |
Catch message event or receive task that creates an instance |
Catch signal event |
Receive task |
You know who the receiver is at design time |
Yes |
No |
Yes |
You want to send the 'message' to ... receivers |
One |
Any number |
One |
Failure of called process propagates to calling process* |
No |
No |
Yes |
Note
Propagation of failures will be covered in Chapter 4, Handling Exceptions.