4 ms·
Where is the state? What changes in response to the send? Here, it'd be the cheese, so it'd make sense to have the cheese be the receiver; but a real answer com
by tonyg 8y ago
Where is the state? What changes in response to the send? Here, it'd be the cheese, so it'd make sense to have the cheese be the receiver; but a real answer comes from moving further toward the Actor perspective. Given a distributed system with message passing, how do you choose to allocate locations to items of mutable state? That choice gives you your answer.
All single-receiver systems have a problem when faced with multiple otherwise-independent pieces of state that have to change in response to a given combination. You end up encoding various kinds of transaction to keep every member of the group on the same page.
Multiple-dispatch systems don't have that problem, but the tradeoff is that they're no longer message passing: all the "recipients" of a "message" live logically in the "same" location for the purposes of handling a given invocation, and if they're actually physically separated, the language implementer has to do the job of providing the illusion (e.g. via transactions) that they're in the same place.