You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After execution of an async receive handler in an actor suspends the mailbox so that the ReceiveTimeout messages are not delivered, until the next message resumes the mailbox. In a following example:
public class MyActor : ReceiveActor
{
public MyActor()
{
Receive<string>(async _ =>
{
var result = await DoSomethingAsync();
Context.SetReceiveTimeout(TimeSpan.FromSeconds(1));
});
Receive<ReceiveTimeout>(_ =>
{
Console.Write("Timed out.");
});
}
}
after sending a string message to an actor initially, even though a receive timeout is configured, the ReceiveTimeout handler is never called.
Using a synchronous handler (replacing await DoSomethingAsync() with DoSomethingAsync().Result) or sending any message to Self in the async handler both seem to fix the problem.