public void Should_Be_Able_To_UnSubscribe() { var subject = new Subject(Guid.NewGuid(), new HashSet <IActorRef>()); var sut = Sys.ActorOf(PubSubActor.CreateProps(subject)); var subscriber = CreateTestActor("subscriber"); var subscribe = new UnSubscribe(subject.Id, subscriber); sut.Tell(subscribe); ExpectNoMsg(); }
public void Should_Not_Be_Able_To_UnSubscribe_To_Wrong_Subject() { var subject = new Subject(Guid.NewGuid(), new HashSet <IActorRef>()); var sut = Sys.ActorOf(PubSubActor.CreateProps(subject)); var subscriber = CreateTestActor("subscriber"); var message = new UnSubscribe(Guid.NewGuid(), subscriber); sut.Tell(message); var result = ExpectMsg <ErrorMessage>(); result.Error.ShouldBeAssignableTo(typeof(ArgumentException)); }
private void OnUnSubscribe(UnSubscribe unSubscribe) { if (_mappingActors.ContainsKey(unSubscribe.Subject)) { if (unSubscribe.Subscriber == null) { _mappingActors[unSubscribe.Subject].Tell(PoisonPill.Instance, Self); _mappingActors.Remove(unSubscribe.Subject); } else { _mappingActors[unSubscribe.Subject].Tell(unSubscribe, Self); } } }
private void OnUnSubscribe(UnSubscribe unSubscribe) { if (_subject.Id.Equals(unSubscribe.Subject)) { if (unSubscribe.Subscriber == null) { _subject?.Dispose(); Self.Tell(PoisonPill.Instance); } else { _subject.RemoveSubscriber(unSubscribe.Subscriber); } } else { UnhandledMessage(unSubscribe); } }
public Task UnSubscribeAsync(UnSubscribe unSubscription) { return(_coordinatorActor.Ask(unSubscription)); }
public void UnSubscribe(UnSubscribe unSubscription, IActorRef sender = null) { _coordinatorActor.Tell(unSubscription, sender); }
public void UnSubscriber(string topicName) { UnSubscribe temp = new UnSubscribe(topicName); SendOpMsg(temp); }
public void UnSubscriber(string topic_name) { UnSubscribe message = new UnSubscribe(topic_name); Send(JsonUtility.ToJson(message)); }