What is the best way to spawn two actors that talks to each other? #212
-
I have a situation that needing two actors talking each other. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
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