Class RemoteExtension
- Namespace
- DMediatR
- Assembly
- DMediatR.dll
IRemote extension methods for connecting to a Dto gRPC service from a MediatR handler.
public static class RemoteExtension
- Inheritance
-
RemoteExtension
- Inherited Members
Methods
PublishRemote(IRemote, ICorrelatedNotification, CancellationToken)
Publish the notification to all distinct connected remote nodes.
public static Task PublishRemote(this IRemote provider, ICorrelatedNotification notification, CancellationToken cancellationToken)
Parameters
provider
IRemoteThe class providing a MediatR handler
notification
ICorrelatedNotificationThe MediatR ICorrelatedNotification.
cancellationToken
CancellationToken
Returns
SendRemote<TResponse>(IRemote, HostOptions, IRequest<TResponse>, CancellationToken)
Send a MediatR IRequest to an explicitly given remote node and receive a TResponse.
public static Task<TResponse> SendRemote<TResponse>(this IRemote provider, HostOptions toHost, IRequest<TResponse> request, CancellationToken cancellationToken)
Parameters
provider
IRemotetoHost
HostOptionsrequest
IRequest<TResponse>cancellationToken
CancellationToken
Returns
- Task<TResponse>
Type Parameters
TResponse
SendRemote<TResponse>(IRemote, IRequest<TResponse>, CancellationToken)
Send a MediatR IRequest to a configured remote node and receive a TResponse.
public static Task<TResponse> SendRemote<TResponse>(this IRemote provider, IRequest<TResponse> request, CancellationToken cancellationToken)
Parameters
provider
IRemoteThe class providing a MediatR handler.
request
IRequest<TResponse>The MediatR IRequest.
cancellationToken
CancellationToken
Returns
- Task<TResponse>
The MediatR TResponse.
Type Parameters
TResponse