Show / Hide Table of Contents

Class EventBusBase

Inheritance
object
EventBusBase
DistributedEventBusBase
LocalEventBus
Implements
IEventBus
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Volo.Abp.EventBus
Assembly: Volo.Abp.EventBus.dll
Syntax
public abstract class EventBusBase : IEventBus

Constructors

EventBusBase(IServiceScopeFactory, ICurrentTenant, IUnitOfWorkManager, IEventHandlerInvoker)

Declaration
protected EventBusBase(IServiceScopeFactory serviceScopeFactory, ICurrentTenant currentTenant, IUnitOfWorkManager unitOfWorkManager, IEventHandlerInvoker eventHandlerInvoker)
Parameters
Type Name Description
Microsoft.Extensions.DependencyInjection.IServiceScopeFactory serviceScopeFactory
ICurrentTenant currentTenant
IUnitOfWorkManager unitOfWorkManager
IEventHandlerInvoker eventHandlerInvoker

Properties

CurrentTenant

Declaration
protected ICurrentTenant CurrentTenant { get; }
Property Value
Type Description
ICurrentTenant

EventHandlerInvoker

Declaration
protected IEventHandlerInvoker EventHandlerInvoker { get; }
Property Value
Type Description
IEventHandlerInvoker

ServiceScopeFactory

Declaration
protected IServiceScopeFactory ServiceScopeFactory { get; }
Property Value
Type Description
Microsoft.Extensions.DependencyInjection.IServiceScopeFactory

UnitOfWorkManager

Declaration
protected IUnitOfWorkManager UnitOfWorkManager { get; }
Property Value
Type Description
IUnitOfWorkManager

Methods

AddToUnitOfWork(IUnitOfWork, UnitOfWorkEventRecord)

Declaration
protected abstract void AddToUnitOfWork(IUnitOfWork unitOfWork, UnitOfWorkEventRecord eventRecord)
Parameters
Type Name Description
IUnitOfWork unitOfWork
UnitOfWorkEventRecord eventRecord

GetEventDataTenantId(object)

Declaration
protected virtual Guid? GetEventDataTenantId(object eventData)
Parameters
Type Name Description
object eventData
Returns
Type Description
System.Guid?

GetHandlerFactories(Type)

Declaration
protected abstract IEnumerable<EventBusBase.EventTypeWithEventHandlerFactories> GetHandlerFactories(Type eventType)
Parameters
Type Name Description
System.Type eventType
Returns
Type Description
System.Collections.Generic.IEnumerable<T><EventBusBase.EventTypeWithEventHandlerFactories>

PublishAsync(Type, object, bool)

Declaration
public virtual Task PublishAsync(Type eventType, object eventData, bool onUnitOfWorkComplete = true)
Parameters
Type Name Description
System.Type eventType
object eventData
bool onUnitOfWorkComplete
Returns
Type Description
System.Threading.Tasks.Task

PublishAsync<TEvent>(TEvent, bool)

Declaration
public Task PublishAsync<TEvent>(TEvent eventData, bool onUnitOfWorkComplete = true) where TEvent : class
Parameters
Type Name Description
TEvent eventData
bool onUnitOfWorkComplete
Returns
Type Description
System.Threading.Tasks.Task
Type Parameters
Name Description
TEvent

PublishToEventBusAsync(Type, object)

Declaration
protected abstract Task PublishToEventBusAsync(Type eventType, object eventData)
Parameters
Type Name Description
System.Type eventType
object eventData
Returns
Type Description
System.Threading.Tasks.Task

Subscribe(Type, IEventHandler)

Declaration
public virtual IDisposable Subscribe(Type eventType, IEventHandler handler)
Parameters
Type Name Description
System.Type eventType
IEventHandler handler
Returns
Type Description
System.IDisposable

Subscribe(Type, IEventHandlerFactory)

Declaration
public abstract IDisposable Subscribe(Type eventType, IEventHandlerFactory factory)
Parameters
Type Name Description
System.Type eventType
IEventHandlerFactory factory
Returns
Type Description
System.IDisposable

Subscribe<TEvent>(Func<TEvent, Task>)

Declaration
public virtual IDisposable Subscribe<TEvent>(Func<TEvent, Task> action) where TEvent : class
Parameters
Type Name Description
System.Func<T, TResult><TEvent, System.Threading.Tasks.Task> action
Returns
Type Description
System.IDisposable
Type Parameters
Name Description
TEvent

Subscribe<TEvent>(IEventHandlerFactory)

Declaration
public virtual IDisposable Subscribe<TEvent>(IEventHandlerFactory factory) where TEvent : class
Parameters
Type Name Description
IEventHandlerFactory factory
Returns
Type Description
System.IDisposable
Type Parameters
Name Description
TEvent

Subscribe<TEvent, THandler>()

Declaration
public virtual IDisposable Subscribe<TEvent, THandler>() where TEvent : class where THandler : IEventHandler, new()
Returns
Type Description
System.IDisposable
Type Parameters
Name Description
TEvent
THandler

SubscribeHandlers(ITypeList<IEventHandler>)

Declaration
protected virtual void SubscribeHandlers(ITypeList<IEventHandler> handlers)
Parameters
Type Name Description
ITypeList<IEventHandler> handlers

ThrowOriginalExceptions(Type, List<Exception>)

Declaration
protected void ThrowOriginalExceptions(Type eventType, List<Exception> exceptions)
Parameters
Type Name Description
System.Type eventType
System.Collections.Generic.List<T><System.Exception> exceptions

TriggerHandlerAsync(IEventHandlerFactory, Type, object, List<Exception>, InboxConfig)

Declaration
protected virtual Task TriggerHandlerAsync(IEventHandlerFactory asyncHandlerFactory, Type eventType, object eventData, List<Exception> exceptions, InboxConfig inboxConfig = null)
Parameters
Type Name Description
IEventHandlerFactory asyncHandlerFactory
System.Type eventType
object eventData
System.Collections.Generic.List<T><System.Exception> exceptions
InboxConfig inboxConfig
Returns
Type Description
System.Threading.Tasks.Task

TriggerHandlersAsync(Type, object, List<Exception>, InboxConfig)

Declaration
protected virtual Task TriggerHandlersAsync(Type eventType, object eventData, List<Exception> exceptions, InboxConfig inboxConfig = null)
Parameters
Type Name Description
System.Type eventType
object eventData
System.Collections.Generic.List<T><System.Exception> exceptions
InboxConfig inboxConfig
Returns
Type Description
System.Threading.Tasks.Task

TriggerHandlersAsync(Type, object)

Declaration
public virtual Task TriggerHandlersAsync(Type eventType, object eventData)
Parameters
Type Name Description
System.Type eventType
object eventData
Returns
Type Description
System.Threading.Tasks.Task

Unsubscribe(Type, IEventHandler)

Declaration
public abstract void Unsubscribe(Type eventType, IEventHandler handler)
Parameters
Type Name Description
System.Type eventType
IEventHandler handler

Unsubscribe(Type, IEventHandlerFactory)

Declaration
public abstract void Unsubscribe(Type eventType, IEventHandlerFactory factory)
Parameters
Type Name Description
System.Type eventType
IEventHandlerFactory factory

Unsubscribe<TEvent>(Func<TEvent, Task>)

Declaration
public abstract void Unsubscribe<TEvent>(Func<TEvent, Task> action) where TEvent : class
Parameters
Type Name Description
System.Func<T, TResult><TEvent, System.Threading.Tasks.Task> action
Type Parameters
Name Description
TEvent

Unsubscribe<TEvent>(IEventHandlerFactory)

Declaration
public virtual void Unsubscribe<TEvent>(IEventHandlerFactory factory) where TEvent : class
Parameters
Type Name Description
IEventHandlerFactory factory
Type Parameters
Name Description
TEvent

Unsubscribe<TEvent>(ILocalEventHandler<TEvent>)

Declaration
public virtual void Unsubscribe<TEvent>(ILocalEventHandler<TEvent> handler) where TEvent : class
Parameters
Type Name Description
ILocalEventHandler<TEvent> handler
Type Parameters
Name Description
TEvent

UnsubscribeAll(Type)

Declaration
public abstract void UnsubscribeAll(Type eventType)
Parameters
Type Name Description
System.Type eventType

UnsubscribeAll<TEvent>()

Declaration
public virtual void UnsubscribeAll<TEvent>() where TEvent : class
Type Parameters
Name Description
TEvent

Implements

IEventBus

Extension Methods

AbpObjectExtensions.As<T>(object)
AbpObjectExtensions.To<T>(object)
LockExtensions.Locking(object, Action)
LockExtensions.Locking<TResult>(object, Func<TResult>)
AbpObjectExtensions.If<T>(T, bool, Action<T>)
AbpObjectExtensions.If<T>(T, bool, Func<T, T>)
AbpObjectExtensions.IsIn<T>(T, IEnumerable<T>)
AbpObjectExtensions.IsIn<T>(T, params T[])
AbpQueryableExtensions.OrderByIf<T, TQueryable>(TQueryable, bool, string)
AbpQueryableExtensions.PageBy<T, TQueryable>(TQueryable, int, int)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, bool>>)
AbpQueryableExtensions.WhereIf<T, TQueryable>(TQueryable, bool, Expression<Func<T, int, bool>>)
LockExtensions.Locking<T>(T, Action<T>)
LockExtensions.Locking<T, TResult>(T, Func<T, TResult>)
In This Article
Back to top Powered by Volosoft