#pragma warning restore 1591 // Xml Comments Dictionary <Type, IProcessEvents> GetSubscriberInstancesFromEvents(IEnumerable <IEvent> events) { var subscribersBySubscriberTypes = new Dictionary <Type, IProcessEvents>(); foreach (var @event in events) { var eventType = @event.GetType(); var subscriptions = _allSubscriptions.Where(s => s.EventType.Equals(eventType)); foreach (var subscription in subscriptions) { IProcessEvents instance = null; if (subscribersBySubscriberTypes.ContainsKey(subscription.Owner)) { instance = subscribersBySubscriberTypes[subscription.Owner]; } else { instance = _container.Get(subscription.Owner) as IProcessEvents; subscribersBySubscriberTypes[subscription.Owner] = instance; } } } return(subscribersBySubscriberTypes); }
public ProcessTracker(IProcessEvents parent) { this.parent = parent; this.parent.ProcessStarted += this.OnProcessStarted; this.parent.ProcessStopped += this.OnProcessStopped; this.processes = new Dictionary <int, ProcessData>(); }
public ProcessTracker(IProcessEvents parent) { this.parent = parent; this.parent.ProcessStarted += this.OnProcessStarted; this.parent.ProcessStopped += this.OnProcessStopped; this.processes = new Dictionary<int, ProcessData>(); }
void Process(EventSubscription subscription, IProcessEvents subscriber, IEvent @event) { using (_localizer.BeginScope()) { subscription.Method.Invoke(subscriber, new[] { @event }); UpdateExistingSubscriptionFrom(subscription, @event.Id); } }
public void Subscribe(string topicName, IProcessEvents eventProcessor) { var queueName = $"{eventProcessor.QueuePrefix}.{topicName}"; var subscription = connection.SubscribeAsync(topicName, queueName); subscription.MessageHandler += eventProcessor.HandleSubscription; subscription.Start(); subscriptions.Add(subscription); this.log.Information($"Started subscription for {topicName} using queue {queueName}"); }
public CommandEventProcessingDecorator(IProcessEvents events, Func <IHandleCommand <TCommand> > handlerFactory) { _events = events; _handlerFactory = handlerFactory; }
public void Add(string key, IProcessEvents value) { this.maps.Add(key, value); }
public QueryEventProcessingDecorator(IProcessEvents events, Func <IHandleQuery <TQuery, TResult> > handlerFactory) { _events = events; _handlerFactory = handlerFactory; }