Exemple #1
0
 public INanoEventBus <T> GetNanoEventBus <T>() where T : IDomainDocument
 {
     return((INanoEventBus <T>)_nanoEventBusses.GetOrAdd(typeof(T), type =>
     {
         DocumentTypeMap.TryAdd(type.FullName, type);
         return new NanoEventBus <T>(this);
     }));
 }
Exemple #2
0
        internal Task DistributePublishMessageAsync(NanoPublishMessage publishMessage)
        {
            //distribute nano message local callbacks
            Type documentType;

            if (DocumentTypeMap.TryGetValue(publishMessage.DocumentTypeName, out documentType))
            {
                INanoEventBus nanoEventBus;
                if (NanoEventBusses.TryGetValue(documentType, out nanoEventBus))
                {
                    return(nanoEventBus.DistributeAsync(publishMessage));
                }
            }

            throw new InvalidOperationException();
        }
Exemple #3
0
 public GenericDocumentTest()
 {
     this.tf = new DocumentTypeMap();
     tf.Add("even", typeof(GDTest));
     tf.Add("odd", typeof(GDTest));
 }