Table of Contents

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 TRequest

The model that is handled by a delegate.

result TResponse

The value returned from the request; otherwise the default value for TResponse of the result parameter.

Returns

Boolean

true if a delegate matching the specified request 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 TRequest

The model that is handled by a function delegate.

ct CancellationToken

The 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.

See Also