Skip to content

What is the best way to spawn two actors that talks to each other? #212

Answered by slawlor
Escapingbug asked this question in Q&A
Discussion options

You must be logged in to vote

Generally it's not super easy to set up two actors with references to each other since that forms a cycle. What normally you would do start actor a, then start actor b passing a handle to a in B's startup routine. You and then send a message to actor a that b is running, and past the handle to b. Then they can send messages to each other.

However if you only need one actor to call the other and get a reply, that's what RPC is for. If you have a toy sample or a gist I could maybe give more guidance

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by slawlor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants