Class RemoteConnection
represents a connection to a remote server that hosts command and event handlers
Inherited Members
Namespace: FastEndpoints
Assembly: FastEndpoints.Messaging.Remote.dll
Syntax
public sealed class RemoteConnection
Properties
ChannelOptions
grpc channel settings
Declaration
public GrpcChannelOptions ChannelOptions { get; set; }
Property Value
Type | Description |
---|---|
GrpcChannelOptions |
RemoteAddress
the address of the remote server
Declaration
public string RemoteAddress { get; init; }
Property Value
Type | Description |
---|---|
string |
Methods
RegisterClientStream<T, TResult>()
register a remote handler for a "client stream" (IAsyncEnumerable<T>) for this remote connection.
Declaration
public void RegisterClientStream<T, TResult>() where T : class where TResult : class
Type Parameters
Name | Description |
---|---|
T | the type of the items in the stream |
TResult | the type of the result that will be received when the stream ends |
RegisterEvent<TEvent>()
register an "event" that the remote server will be accepting (in EventBroker) for distribution to subscribers.
Declaration
public void RegisterEvent<TEvent>() where TEvent : class, IEvent
Type Parameters
Name | Description |
---|---|
TEvent | the type of the event |
RegisterServerStream<TCommand, TResult>()
register a "server stream" command (IServerStreamCommand<TResult>) for this remote connection where the handler for it is hosted/located.
Declaration
public void RegisterServerStream<TCommand, TResult>() where TCommand : class, IServerStreamCommand<TResult> where TResult : class
Type Parameters
Name | Description |
---|---|
TCommand | the type of the command |
TResult | the type of the result stream |
Register<TCommand>()
register a "void" command (ICommand) for this remote connection where the handler for it is hosted/located.
Declaration
public void Register<TCommand>() where TCommand : class, ICommand
Type Parameters
Name | Description |
---|---|
TCommand | the type of the command |
Register<TCommand, TResult>()
register a "unary" command (ICommand<TResult>) for this remote connection where the handler for it is hosted/located.
Declaration
public void Register<TCommand, TResult>() where TCommand : class, ICommand<TResult> where TResult : class
Type Parameters
Name | Description |
---|---|
TCommand | the type of the command |
TResult | the type of the result |
Subscribe<TEvent, TEventHandler>(CallOptions)
subscribe to a broadcast channel for a given event type (TEvent
) on the remote host.
the received events will be handled by the specified handler (TEventHandler
) on this machine.
Declaration
public void Subscribe<TEvent, TEventHandler>(CallOptions callOptions = default) where TEvent : class, IEvent where TEventHandler : IEventHandler<TEvent>
Parameters
Type | Name | Description |
---|---|---|
CallOptions | callOptions | the call options |
Type Parameters
Name | Description |
---|---|
TEvent | the type of the events that will be received |
TEventHandler | the handler that will be handling the received events |