Interface IRequestReplyActivator<TRequest>
- Namespace
- Savvyio.Handlers
- Assembly
- Savvyio.Core.dll
Specifies a way of invoking Request-Reply/In-Out MEP delegates that handles TRequest
.
public interface IRequestReplyActivator<in TRequest>
Type Parameters
TRequest
The type of the model to invoke on a handler.
Methods
TryInvoke<TResponse>(TRequest, out TResponse)
Invokes (if registered) the delegate handling the specified request
.
bool TryInvoke<TResponse>(TRequest request, out TResponse result)
Parameters
request
TRequestThe model that is handled by a delegate.
result
TResponseThe value returned from the request; otherwise the default value for
TResponse
of theresult
parameter.
Returns
- Boolean
true
if a delegate matching the specifiedrequest
was invoked; otherwise,false
.
Type Parameters
TResponse
The type of the response.
TryInvokeAsync<TResponse>(TRequest, CancellationToken)
Invokes (if registered) the function delegate handling the specified request
.
Task<ConditionalValue<TResponse>> TryInvokeAsync<TResponse>(TRequest request, CancellationToken ct = default(CancellationToken))
Parameters
request
TRequestThe model that is handled by a function delegate.
ct
CancellationTokenThe cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ConditionalValue<TResponse>>
A task that represents the asynchronous operation. The task result contains a ConditionalValue that indicates if a function delegate matching the specified
request
was invoked and with the potential result hereof.
Type Parameters
TResponse
The type of the response.