Aaronontheweb on dev
added `VectorClock` benchmark (… (compare)
I think that any DI scope which effectively takes away lifecycle management from the ActorSystem, are not supported. Because it would mean that an Actor could be disposed without the Actor system being aware of it
Just wrap your ActorRef in something that implements IDisposable and kills the actor after being disposed
interface IDisposableActor<T> : IDisposable
{
ActorRef Actor{get;}
}
class DisposableActor<T> : IDisposableActor<T>
{
public ActorRef Actor {get; private set;}
public DisposableActor()
{
Actor = ActorSystem.ActorOf<T>();
}
public void Dispose()
{
Actor.Tell(oisonPill.Instance, ActorRef.NoSender);
}
}