I'm having hard times with Actor delete. I've created custom base service to enable backup on my Actor System bu unfortunately having Task.Delay() inside RunAsync forbid me from actor delete (DeleteActorAsync hangs).
My RunAsync in custom service have simple construction:
protected override async Task RunAsync(CancellationToken cancellationToken)
{
await Task.Delay(500, cancellationToken);
}
That's it. When I remove delay and replace with standard base.RunAsync() actor delete runs with no problems.
Can anybody suggest something? I'm unable to find anything usable in documentation.
I've managed to find issue in ActorService source code (although it was already in code remarks of ActorService.RunAsync()).
You have to run base.RunAsync(...) if you override this in custom implementation :)
protected override async Task RunAsync(CancellationToken cancellationToken)
{
await base.RunAsync(cancellationToken);
await Task.Delay(500, cancellationToken);
}
That's all. Everything now works perfectly!