-
What could happen if I had a async method and I called it in a handler without awaiting it? Could this cause problems? private void ReceiveMyMessage(MyMessage msg)
{
_ = SomeAsyncMethod();
} |
Beta Was this translation helpful? Give feedback.
Answered by
Arkatufus
Apr 25, 2023
Replies: 1 comment 1 reply
-
It really depends on the async code, if it is thread safe and does not have any callback that references any of the actor state then it should be fine. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tjaart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It really depends on the async code, if it is thread safe and does not have any callback that references any of the actor state then it should be fine.
What happens is that the thread Task will be launched as a detached Task outside of the actor system scheduler and its completion will not be checked. This is akin to declaring your method as
async void