Reputation: 652
An actor can be sent a message with actor.send()
or actor.offer()
Once my actor gets the message from its channel I'd like to return a response. How do I do this? I don't see any obvious built in method.
Upvotes: 4
Views: 1396
Reputation: 81939
You need to request the Actor
’s channel
,
as documented:
[The
actor
coroutine builder] Launches new coroutine that is receiving messages from its mailbox channel and returns a reference to the coroutine as anActorJob
. The resulting object can be used to send messages to this coroutine.
Here’s a simple example.
Upvotes: 6