/// <summary> /// Attach an event source to the context in order to forward it's events to the configured pipelines. /// </summary> /// <param name="source">The event source.</param> /// <param name="eventsScope">The scope of the events published from this source.</param> public virtual void Attach(object source, EventsScope eventsScope) => GetCurrentInternalServiceProvider() .GetRequiredService <IAttachingService>() .Attach(source, eventsScope);
/// <summary> /// Continues the processing of the events that have been queued. /// </summary> /// <param name="eventsScope">The scope where the queued events were published.</param> /// <param name="queueName"> /// The name of the queue. /// If null all the events will be processed. /// </param> public virtual Task ProcessQueuedEventsAsync(EventsScope eventsScope, string queueName = null) => GetCurrentInternalServiceProvider() .GetRequiredService <IEventsQueuesService>() .ProcessQueuedEventsAsync(eventsScope, queueName);
/// <summary> /// Discards all the events of a queue. /// </summary> /// <param name="eventsScope">The scope where the queued events were published.</param> /// <param name="queueName"> /// The name of the queue. /// If null all the events will be discarded. /// </param> public virtual void DiscardQueuedEvents(EventsScope eventsScope, string queueName = null) => GetCurrentInternalServiceProvider() .GetRequiredService <IEventsQueuesService>() .DiscardQueuedEvents(eventsScope, queueName);