What is the best way to implement the following example ?
-
Actor
serverreceivesRequests,
handles them, creates a newResponse
for eachRequestand sends theResponseback
to theRequestsender. -
Actor
clientsendsRequestsand
receivesResponses.
All this communication is asynchronous and hence it uses react.
This is just an example and so it should not handle all those cases like server is down, client is stuck, etc. It should be just concise and expressive.
Usage:
With regards to:
Actors that use
receiveare also asynchronous. They just block the thread, waiting for a new messages.