public Unit ShutdownProcess(bool maintainState) { lock (sync) { return(Parent.Actor.Children.Find(Name.Value).IfSome(self => { ShutdownProcessRec(self, sys.GetInboxShutdownItem().Map(x => (ILocalActorInbox)x.Inbox), maintainState); Parent.Actor.UnlinkChild(Id); children = Map.empty <string, ActorItem>(); })); } }
public Unit ShutdownProcess(bool maintainState) { cancellationTokenSource.Cancel(); lock (sync) { return(Parent.Actor.Children.Find(Name.Value).IfSome(self => { ShutdownProcessRec(self, sys.GetInboxShutdownItem().Map(x => (ILocalActorInbox)x.Inbox), maintainState); Parent.Actor.UnlinkChild(Id); children.Swap(_ => HashMap <string, ActorItem>()); })); } }