Class RemoteConnectionExtensions
client extension methods
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.Messaging.Remote.dll
Syntax
public static class RemoteConnectionExtensions
Methods
AddEventSubscriberStorageProvider<TStorageRecord, TStorageProvider>(IServiceCollection)
register a custom event subscriber storage provider
Declaration
public static IServiceCollection AddEventSubscriberStorageProvider<TStorageRecord, TStorageProvider>(this IServiceCollection services) where TStorageRecord : IEventStorageRecord, new() where TStorageProvider : class, IEventSubscriberStorageProvider<TStorageRecord>
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
Type Parameters
| Name | Description |
|---|---|
| TStorageRecord | the type of the storage record |
| TStorageProvider |
MapRemote(IHost, string, Action<RemoteConnection>)
creates a grpc channel/connection to a remote server that hosts a known collection of command handlers and event hubs.
IMPORTANT: call the Register<TCommand, TResult>() method (using action r) to specify which commands are
handled by this remote server. event subscriptions can be specified using app.Subscribe<TEvent, TEventHandler>() method.
Declaration
public static IHost MapRemote(this IHost host, string remoteAddress, Action<RemoteConnection> r)
Parameters
| Type | Name | Description |
|---|---|---|
| IHost | host | |
| string | remoteAddress | the address of the remote server |
| Action<RemoteConnection> | r | a configuration action for the connection |
Returns
| Type | Description |
|---|---|
| IHost |
RemotePublishAsync(IEvent, CallOptions)
publish the event to the relevant remote server that's running in EventBroker mode.
Declaration
public static Task RemotePublishAsync(this IEvent @event, CallOptions options = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IEvent | event | |
| CallOptions | options | call options |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | thrown if the relevant remote handler has not been registered |
RemotePublishAsync(IEvent, CancellationToken)
publish the event to the relevant remote server that's running in EventBroker mode.
Declaration
public static Task RemotePublishAsync(this IEvent @event, CancellationToken ct)
Parameters
| Type | Name | Description |
|---|---|---|
| IEvent | event | |
| CancellationToken | ct | cancellation token |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | thrown if the relevant remote handler has not been registered |