This is weird to me:
"A method is called asynchronously when the return value is not used."
Which means the behavior changes when there is no return value?
Which means the behavior changes when there is no return value?
async remote_actor.foobar()
If you on the other hand want to wait for that remote actor to finish but still not assign locally you can use a dummy variable: _ = remote_actor.foobar()
or explicitly ask to await await async remote_actor.foobar()
You can also explicitly ask for async while grabbing the return value, which makes it easy to run things concurrently a1 = async remote_actor1.foobar()
a2 = async remote_actor2.foobar()
print("a1 and a2 run concurrently")
r1 = await a1 # collect both results
r2 = await a2
print(r1, r2)I guess this means when a return value is used, the call is synchronous, and after running the method processing resumes where things left off.
a = await async remote_actor.foobar()
So the local actor goes to sleep, awaiting the remote, then the RTS notices the returned value and place the actor on the readyQ for execution, thus waking up from the await.