Fast.EventBus public API
Targets: net8.0;net9.0;net10.0. This is a declaration and XML-comment reference. See the module guide for usage and constraints.
Source commit: 43554c07f6c216f80b509bd535c0a5b66ae7f2e8. Maintained through scripts/export-dotnet-api.ps1 -Language en; ordinary site builds consume this file directly.
Fast.EventBus.EventSubscribeAttribute
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
public sealed class EventSubscribeAttribute : AttributeEvent handler attribute
Remarks: Applied to instance methods on IEventSubscriber implementations; multiple event IDs can invoke the same handler
Fast.EventBus.EventSubscribeAttribute.EventSubscribeAttribute
Source · Targets: net8.0, net9.0, net10.0
public EventSubscribeAttribute(object eventId)Initializes a new instance of the class
Remarks: Only event and Enum types are supported
- Parameter
eventId: Logging event identifier
Fast.EventBus.EventSubscribeAttribute.EventId
Source · Targets: net8.0, net9.0, net10.0
public string EventId { get; set; }Event ID
Fast.EventBus.EventSubscribeAttribute.GCCollect
Source · Targets: net8.0, net9.0, net10.0
public object GCCollect { get; set; } = false;Whether to trigger garbage collection after execution
Remarks: Disabled by default; normally let the runtime decide when to collect garbage
Fast.EventBus.EventSubscribeAttribute.NumRetries
Source · Targets: net8.0, net9.0, net10.0
public int NumRetries { get; set; } = 0;Retry count
Fast.EventBus.EventSubscribeAttribute.RetryTimeout
Source · Targets: net8.0, net9.0, net10.0
public int RetryTimeout { get; set; } = 1000;Retry interval
Remarks: Defaults to 1000 milliseconds
Fast.EventBus.EventSubscribeAttribute.ExceptionTypes
Source · Targets: net8.0, net9.0, net10.0
public Type[] ExceptionTypes { get; set; }Can restrict retries to specific exception types
Fast.EventBus.EventSubscribeAttribute.FallbackPolicy
Source · Targets: net8.0, net9.0, net10.0
public Type FallbackPolicy { get; set; }Retry failure policy configuration
Fast.EventBus.EventSubscribeAttribute.Order
Source · Targets: net8.0, net9.0, net10.0
public int Order { get; set; } = 0;Order
Remarks: Larger values execute first
Fast.EventBus.EventHandlerContext
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public abstract class EventHandlerContextEvent handler context
Fast.EventBus.EventHandlerContext.Source
Source · Targets: net8.0, net9.0, net10.0
public IEventSource Source { get; }Event source carrying the event data
Fast.EventBus.EventHandlerContext.Properties
Source · Targets: net8.0, net9.0, net10.0
public IDictionary<object, object> Properties { get; set; }Shared context data
Fast.EventBus.EventHandlerContext.HandlerMethod
Source · Targets: net8.0, net9.0, net10.0
public MethodInfo HandlerMethod { get; }Invoked method
Remarks: May be null for dynamic subscriptions
Fast.EventBus.EventHandlerContext.Attribute
Source · Targets: net8.0, net9.0, net10.0
public EventSubscribeAttribute Attribute { get; }Subscription attribute
Remarks: May be null for dynamic subscriptions
Fast.EventBus.EventHandlerExecutedContext
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public sealed class EventHandlerExecutedContext : EventHandlerContextPost-execution event handler context
Fast.EventBus.EventHandlerExecutedContext.ExecutedTime
Source · Targets: net8.0, net9.0, net10.0
public DateTime ExecutedTime { get; internal set; }Post-execution time
Fast.EventBus.EventHandlerExecutedContext.Exception
Source · Targets: net8.0, net9.0, net10.0
public InvalidOperationException Exception { get; internal set; }Exception information
Fast.EventBus.EventHandlerExecutingContext
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public sealed class EventHandlerExecutingContext : EventHandlerContextPre-execution event handler context
Fast.EventBus.EventHandlerExecutingContext.ExecutingTime
Source · Targets: net8.0, net9.0, net10.0
public DateTime ExecutingTime { get; internal set; }Pre-execution time
Fast.EventBus.EventBusExtension
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public static class EventBusExtensionEvent bus extensions
Fast.EventBus.EventBusExtension.EventBusToString
Source · Targets: net8.0, net9.0, net10.0
public static string EventBusToString(this Enum em)Converts an enum event ID to a string
- Parameter
em: Enum value to convert to an event identifier string - Returns: Converts an enum event ID to a string
Fast.EventBus.EventBusExtension.EventBusToEnum
Source · Targets: net8.0, net9.0, net10.0
public static Enum EventBusToEnum(this string str)Converts an enum event string to an enum object
- Parameter
str: String to process - Returns: Converts an enum event string to an enum object
Fast.EventBus.IServiceCollectionExtension
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public static class IServiceCollectionExtensionDynamic API extensions for IServiceCollection
Fast.EventBus.IServiceCollectionExtension.AddEventBus
Source · Targets: net8.0, net9.0, net10.0
public static IServiceCollection AddEventBus(this IServiceCollection services)Adds event bus services
- Parameter
services: The service collection to add services to - Returns: Returns
servicesfor chaining
Fast.EventBus.IEventBusFactory
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public interface IEventBusFactoryEvent bus factory
Fast.EventBus.IEventBusFactory.Subscribe
Source · Targets: net8.0, net9.0, net10.0
Task Subscribe(string eventId, Func<EventHandlerExecutingContext, Task> handler, EventSubscribeAttribute attribute = null,
MethodInfo handlerMethod = null, CancellationToken cancellationToken = default);Adds an event subscriber
- Parameter
eventId: Logging event identifier - Parameter
handler: Delegate handling the current event or request - Parameter
attribute: EventSubscribeAttribute instance - Parameter
handlerMethod: Event handler method - Parameter
cancellationToken: Token used to cancel the asynchronous operation - Returns: A task representing asynchronous event subscriber registration
Fast.EventBus.IEventBusFactory.Unsubscribe
Source · Targets: net8.0, net9.0, net10.0
Task Unsubscribe(string eventId, CancellationToken cancellationToken = default);Removes an event subscriber
- Parameter
eventId: Logging event identifier - Parameter
cancellationToken: Token used to cancel the asynchronous operation - Returns: A task representing asynchronous event subscriber removal
Fast.EventBus.IEventSubscriber
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public interface IEventSubscriberEvent subscriber dependency interface
Remarks: Custom event handlers must match Func{EventSubscribeExecutingContext, Task}. Usually used for dependency discovery rather than service invocation.
Fast.EventBus.IEventHandlerMonitor
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public interface IEventHandlerMonitorEvent handler monitor
Fast.EventBus.IEventHandlerMonitor.OnExecutingAsync
Source · Targets: net8.0, net9.0, net10.0
Task OnExecutingAsync(EventHandlerExecutingContext context);Before event handler execution
- Parameter
context: Current event handling context - Returns: A task representing the pre-execution event handler operation
Fast.EventBus.IEventHandlerMonitor.OnExecutedAsync
Source · Targets: net8.0, net9.0, net10.0
Task OnExecutedAsync(EventHandlerExecutedContext context);After event handler execution
- Parameter
context: Current event handling context - Returns: A task representing the post-execution event handler operation
Fast.EventBus.IEventFallbackPolicy
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public interface IEventFallbackPolicyEvent retry failure callback service
Fast.EventBus.IEventFallbackPolicy.CallbackAsync
Source · Targets: net8.0, net9.0, net10.0
Task CallbackAsync(EventHandlerExecutingContext context, Exception ex);Callback after retry failure
- Parameter
context: Current event handling context - Parameter
ex: Exception that triggered the current handling flow - Returns: A task representing the retry failure callback
Fast.EventBus.IEventPublisher
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public interface IEventPublisherEvent publisher dependency interface
Fast.EventBus.IEventPublisher.PublishAsync
Source · Targets: net8.0, net9.0, net10.0
Task PublishAsync(IEventSource eventSource);Publishes a message
- Parameter
eventSource: Event message to publish - Returns: A task representing message publication
Fast.EventBus.IEventPublisher.PublishDelayAsync
Source · Targets: net8.0, net9.0, net10.0
Task PublishDelayAsync(IEventSource eventSource, long delay);Publishes a message after a delay
- Parameter
eventSource: Event message to publish - Parameter
delay: Delay duration - Returns: A task representing delayed message publication
Fast.EventBus.IEventPublisher.PublishAsync
Source · Targets: net8.0, net9.0, net10.0
Task PublishAsync(string eventId, object payload = null, CancellationToken cancellationToken = default);Publishes a message
- Parameter
eventId: Logging event identifier - Parameter
payload: Payload to write into the token - Parameter
cancellationToken: Token used to cancel the asynchronous operation - Returns: A task representing message publication
Fast.EventBus.IEventPublisher.PublishAsync
Source · Targets: net8.0, net9.0, net10.0
Task PublishAsync(Enum eventId, object payload = null, CancellationToken cancellationToken = default);Publishes a message
- Parameter
eventId: Logging event identifier - Parameter
payload: Payload to write into the token - Parameter
cancellationToken: Token used to cancel the asynchronous operation - Returns: A task representing message publication
Fast.EventBus.IEventPublisher.PublishDelayAsync
Source · Targets: net8.0, net9.0, net10.0
Task PublishDelayAsync(string eventId, long delay, object payload = null, CancellationToken cancellationToken = default);Publishes a message after a delay
- Parameter
eventId: Logging event identifier - Parameter
delay: Delay duration - Parameter
payload: Payload to write into the token - Parameter
cancellationToken: Token used to cancel the asynchronous operation - Returns: A task representing delayed message publication
Fast.EventBus.IEventPublisher.PublishDelayAsync
Source · Targets: net8.0, net9.0, net10.0
Task PublishDelayAsync(Enum eventId, long delay, object payload = null, CancellationToken cancellationToken = default);Publishes a message after a delay
- Parameter
eventId: Logging event identifier - Parameter
delay: Delay duration - Parameter
payload: Payload to write into the token - Parameter
cancellationToken: Token used to cancel the asynchronous operation - Returns: A task representing delayed message publication
Fast.EventBus.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public sealed class ChannelEventSource : IEventSourceIn-memory channel event source carrying event data
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource()Initializes a new instance of the class
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource(string eventId)Initializes a new instance of the class
- Parameter
eventId: Logging event identifier
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource(string eventId, object payload) : this(eventId)Initializes a new instance of the class
- Parameter
eventId: Logging event identifier - Parameter
payload: Payload to write into the token
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource(string eventId, object payload, CancellationToken cancellationToken) : this(eventId, payload)Initializes a new instance of the class
- Parameter
eventId: Logging event identifier - Parameter
payload: Payload to write into the token - Parameter
cancellationToken: Token used to cancel the asynchronous operation
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource(Enum eventId) : this(eventId.EventBusToString())Initializes a new instance of the class
- Parameter
eventId: Logging event identifier
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource(Enum eventId, object payload) : this(eventId.EventBusToString(), payload)Initializes a new instance of the class
- Parameter
eventId: Logging event identifier - Parameter
payload: Payload to write into the token
Fast.EventBus.ChannelEventSource.ChannelEventSource
Source · Targets: net8.0, net9.0, net10.0
public ChannelEventSource(Enum eventId, object payload, CancellationToken cancellationToken) : this(
eventId.EventBusToString(), payload, cancellationToken)Initializes a new instance of the class
- Parameter
eventId: Logging event identifier - Parameter
payload: Payload to write into the token - Parameter
cancellationToken: Token used to cancel the asynchronous operation
Fast.EventBus.ChannelEventSource.EventId
Source · Targets: net8.0, net9.0, net10.0
public string EventId { get; set; }Documentation is inherited from an interface or base class; consult that declaration.
Fast.EventBus.ChannelEventSource.Payload
Source · Targets: net8.0, net9.0, net10.0
public object Payload { get; set; }Documentation is inherited from an interface or base class; consult that declaration.
Fast.EventBus.ChannelEventSource.CreatedTime
Source · Targets: net8.0, net9.0, net10.0
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;Documentation is inherited from an interface or base class; consult that declaration.
Fast.EventBus.ChannelEventSource.CancellationToken
Source · Targets: net8.0, net9.0, net10.0
[JsonIgnore]
public CancellationToken CancellationToken { get; set; }Documentation is inherited from an interface or base class; consult that declaration.
Fast.EventBus.IEventSource
Source · Targets: net8.0, net9.0, net10.0
[SuppressSniffer]
public interface IEventSourceEvent source dependency interface
Fast.EventBus.IEventSource.EventId
Source · Targets: net8.0, net9.0, net10.0
string EventId { get; }Event ID
Fast.EventBus.IEventSource.Payload
Source · Targets: net8.0, net9.0, net10.0
object Payload { get; }Event payload data
Fast.EventBus.IEventSource.CreatedTime
Source · Targets: net8.0, net9.0, net10.0
DateTime CreatedTime { get; }Event creation time
Fast.EventBus.IEventSource.CancellationToken
Source · Targets: net8.0, net9.0, net10.0
CancellationToken CancellationToken { get; }Task cancellation token
Remarks: Used to cancel handling of this message
