public void Unwatch(PID pid) { pid.SendSystemMessage(new Unwatch(Self)); if (_watching == null) { _watching = new FastSet <PID>(); } _watching.Remove(pid); }
public void Watch(PID pid) { pid.SendSystemMessage(new Watch(Self)); if (_watching == null) { _watching = new FastSet <PID>(); } _watching.Add(pid); }
public PID SpawnNamed(Props props, string name) { var pid = props.Spawn($"{Self.Id}/{name}", Self); if (_children == null) { _children = new FastSet <PID>(); } _children.Add(pid); return(pid); }
public Context(Func <IActor> producer, ISupervisorStrategy supervisorStrategy, Receive receiveMiddleware, Sender senderMiddleware, PID parent) { _producer = producer; _supervisorStrategy = supervisorStrategy; _receiveMiddleware = receiveMiddleware; _senderMiddleware = senderMiddleware; Parent = parent; IncarnateActor(); //fast path if (parent != null) { _watchers = new FastSet <PID>(); _watchers.Add(parent); } }
public PID SpawnNamed(Props props, string name) { if (props.GuardianStrategy != null) { throw new ArgumentException("Props used to spawn child cannot have GuardianStrategy."); } var pid = props.Spawn($"{Self.Id}/{name}", Self); if (_children == null) { _children = new FastSet <PID>(); } _children.Add(pid); return(pid); }
private void HandleWatch(Watch w) { if (_stopping) { w.Watcher.SendSystemMessage(new Terminated() { Who = Self }); } else { if (_watchers == null) { _watchers = new FastSet <PID>(); } _watchers.Add(w.Watcher); } }