Ejemplo n.º 1
0
 public DispatcherBase(IMongoRepository mongoRepository, IGESConnection gesConnection, List <IHandler> eventHandlers)
 {
     _mongoRepository = mongoRepository;
     _gesConnection   = gesConnection.BuildConnection();
     _gesConnection.ConnectAsync();
     _eventHandlers = eventHandlers;
     // add all handlers to the broadcast block so they receive news of events
     RegisterHandlers();
     // gets last event processed to avoid re processing events after a shut down.
     GetLastEventProcessedForHandlers();
 }
Ejemplo n.º 2
0
 public DispatcherBase(IMongoRepository mongoRepository, IGESConnection gesConnection, List<IHandler> eventHandlers)
 {
     _mongoRepository = mongoRepository;
     _gesConnection = gesConnection.BuildConnection();
     _gesConnection.ConnectAsync();
     _eventHandlers = eventHandlers;
     // add all handlers to the broadcast block so they receive news of events
     RegisterHandlers();
     // gets last event processed to avoid re processing events after a shut down.
     GetLastEventProcessedForHandlers();
 }
Ejemplo n.º 3
0
 public CommandDispatcher(IMongoRepository mongoRepository, IGESConnection gesConnection, List<IHandler> eventHandlers) 
     : base(mongoRepository, gesConnection, eventHandlers)
 {
     _targetClrTypeName = "CommandClrTypeName";
     _eventFilter = x =>
         {
             if (x.OriginalEvent.Metadata.Length <= 0 || x.OriginalEvent.Data.Length <= 0)
             { return false; }
             var jProperty = Newtonsoft.Json.Linq.JObject.Parse(Encoding.UTF8.GetString(x.Event.Metadata)).Property(_targetClrTypeName);
             return !x.Event.EventType.StartsWith("$") && jProperty!=null && jProperty.HasValues;
         };
 }
Ejemplo n.º 4
0
 public CommandDispatcher(IMongoRepository mongoRepository, IGESConnection gesConnection, List <IHandler> eventHandlers)
     : base(mongoRepository, gesConnection, eventHandlers)
 {
     _targetClrTypeName = "CommandClrTypeName";
     _eventFilter       = x =>
     {
         if (x.OriginalEvent.Metadata.Length <= 0 || x.OriginalEvent.Data.Length <= 0)
         {
             return(false);
         }
         var jProperty = Newtonsoft.Json.Linq.JObject.Parse(Encoding.UTF8.GetString(x.Event.Metadata)).Property(_targetClrTypeName);
         return(!x.Event.EventType.StartsWith("$") && jProperty != null && jProperty.HasValues);
     };
 }