3 ms·
So you create a function around the message. It's not uncommon at all to have something like (pseudocode) myActorModule.increment(ref, amount) -> ref ! {in
by lostcolony 8y ago
So you create a function around the message. It's not uncommon at all to have something like (pseudocode)
myActorModule.increment(ref, amount) ->
ref ! {increment, amount}
myActorModule.syncIncrement(ref, amount) ->
ref ! {increment, amount, self()}
receive -> ok
timeout 1000.
You can build out the message passing interface to an actor -as- functions, and even supply sync ones if you want. The actor implementation can be completely opaque to the caller; just the exported interface functions are defined, exported, and supported.