Class LambdaSharpEventBusClient
The Lambda
Inheritance
Namespace: LambdaSharp.App
Assembly: LambdaSharp.App.dll
Syntax
public sealed class LambdaSharpEventBusClient : IAsyncDisposable
Constructors
LambdaSharpEventBusClient(LambdaSharpAppConfig, ILogger<LambdaSharpEventBusClient>)
Initializes a new Lambda
Declaration
public LambdaSharpEventBusClient(LambdaSharpAppConfig config, ILogger<LambdaSharpEventBusClient> logger)
Parameters
Type | Name | Description |
---|---|---|
Lambda |
config | A Lambda |
Microsoft. |
logger | A Microsoft. |
Methods
SubscribeTo<T>(String, EventBusPattern, Action<IEventBusSubscription, CloudWatchEvent<T>>)
The SubscribeTo<T>(String, EventBusPattern, Action<IEventBusSubscription, CloudWatchEvent<T>>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string name, EventBusPattern eventPattern, Action<IEventBusSubscription, CloudWatchEvent<T>> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name of the LambdaSharp App EventBus subscription. |
Event |
eventPattern | |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Action<T>)
The SubscribeTo<T>(String, Action<T>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Action<T> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Action<CloudWatchEvent<T>>)
The SubscribeTo<T>(String, Action<CloudWatchEvent<T>>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Action<CloudWatchEvent<T>> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Action<IEventBusSubscription, T>)
The SubscribeTo<T>(String, Action<IEventBusSubscription, T>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Action<IEventBusSubscription, T> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Action<IEventBusSubscription, CloudWatchEvent<T>>)
The SubscribeTo<T>(String, Action<IEventBusSubscription, CloudWatchEvent<T>>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Action<IEventBusSubscription, CloudWatchEvent<T>> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Func<T, Task>)
The SubscribeTo<T>(String, Func<T, Task>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Func<T, Task> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Func<CloudWatchEvent<T>, Task>)
The SubscribeTo<T>(String, Func<CloudWatchEvent<T>, Task>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Func<CloudWatchEvent<T>, Task> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Func<IEventBusSubscription, T, Task>)
The SubscribeTo<T>(String, Func<IEventBusSubscription, T, Task>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Func<IEventBusSubscription, T, Task> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
SubscribeTo<T>(String, Func<IEventBusSubscription, CloudWatchEvent<T>, Task>)
The SubscribeTo<T>(String, Func<IEventBusSubscription, CloudWatchEvent<T>, Task>) method creates a subscription for the specified source and type.
Declaration
public IEventBusSubscription SubscribeTo<T>(string source, Func<IEventBusSubscription, CloudWatchEvent<T>, Task> callback)
Parameters
Type | Name | Description |
---|---|---|
System. |
source | The name of the event source. |
System. |
callback | The callback to invoke when a matching event is received. |
Returns
Type | Description |
---|---|
IEvent |
The subscription instance. |
Type Parameters
Name | Description |
---|---|
T | The event payload type. |
Events
StateChanged
The State
Declaration
public event EventHandler<EventBusStateChangedEventArgs> StateChanged
Event Type
Type | Description |
---|---|
System. |
SubscriptionError
The Subscription
Declaration
public event EventHandler<EventBusSubscriptErrorEventArgs> SubscriptionError
Event Type
Type | Description |
---|---|
System. |