예제 #1
0
 public SubscriberRegistry UnregisterSubscriber(IActorRef subscriber)
 {
     if (AggregateRegistry.TryGetAggregateId(subscriber, out var aggregateId))
     {
         return(new SubscriberRegistry(AggregateRegistry.Remove(subscriber, aggregateId), DefaultRegistry.Remove(subscriber)));
     }
     else
     {
         return(new SubscriberRegistry(AggregateRegistry, DefaultRegistry.Remove(subscriber)));
     }
 }
예제 #2
0
 public SubscriberRegistry RegisterAggregateSubscriber(IActorRef subscriber, string aggregateId) =>
 new SubscriberRegistry(AggregateRegistry.Add(subscriber, aggregateId), DefaultRegistry);
예제 #3
0
 public SubscriberRegistry(AggregateRegistry aggregateRegistry = null, ImmutableHashSet <IActorRef> defaultRegistry = null)
 {
     AggregateRegistry = aggregateRegistry ?? new AggregateRegistry();
     DefaultRegistry   = defaultRegistry ?? ImmutableHashSet <IActorRef> .Empty;
 }