Table of Contents

Interface IOperationHandler<TInput, TResult>

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll

Handler for an operation.

public interface IOperationHandler<TInput, TResult>

Type Parameters

TInput

Operation input type. This should be NoValue to represent no parameter.

TResult

Operation result type. This should be NoValue to represent void return type.

Methods

CancelAsync(OperationCancelContext)

Request operation cancel.

Task CancelAsync(OperationCancelContext context)

Parameters

context OperationCancelContext

Context.

Returns

Task

Task when cancel has been sent.

Exceptions

HandlerException

Unexpected handler failure.

FetchInfoAsync(OperationFetchInfoContext)

Fetch operation info.

Task<OperationInfo> FetchInfoAsync(OperationFetchInfoContext context)

Parameters

context OperationFetchInfoContext

Context.

Returns

Task<OperationInfo>

Task with operation info.

Exceptions

HandlerException

Unexpected handler failure.

FetchResultAsync(OperationFetchResultContext)

Fetch operation result, waiting if necessary.

Task<TResult> FetchResultAsync(OperationFetchResultContext context)

Parameters

context OperationFetchResultContext

Context.

Returns

Task<TResult>

Task with result contents.

Exceptions

OperationStillRunningException

Operation still running (after optional wait).

OperationException

Operation failed.

HandlerException

Unexpected handler failure.

StartAsync(OperationStartContext, TInput)

Start operation.

Task<OperationStartResult<TResult>> StartAsync(OperationStartContext context, TInput input)

Parameters

context OperationStartContext

Context.

input TInput

Input.

Returns

Task<OperationStartResult<TResult>>

Task with sync or async result.

Exceptions

OperationException

Operation failed.

HandlerException

Unexpected handler failure.