/// <summary> /// Returns false if the <see cref="_promise"/> is already completed. /// </summary> private bool AddWatcher(IActorRef watcher) { if (WatchedBy.Contains(watcher)) { return(false); } return(UpdateWatchedBy(WatchedBy, WatchedBy.Add(watcher)) || AddWatcher(watcher)); }
private void RemoveWatcher(IActorRef watcher) { if (!WatchedBy.Contains(watcher)) { return; } if (!UpdateWatchedBy(WatchedBy, WatchedBy.Remove(watcher))) { RemoveWatcher(watcher); } }