Table of Contents

Class OperationHandler

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll
public static class OperationHandler
Inheritance
OperationHandler
Inherited Members

Methods

Sync<TInput, TResult>(Func<OperationStartContext, TInput, Task<TResult>>)

Create a synchronous (start-only) operation from the given async lambda.

public static IOperationHandler<TInput, TResult> Sync<TInput, TResult>(Func<OperationStartContext, TInput, Task<TResult>> apply)

Parameters

apply Func<OperationStartContext, TInput, Task<TResult>>

Lambda that is invoked on each operation start.

Returns

IOperationHandler<TInput, TResult>

Operation handler that only supports start with synchronous response.

Type Parameters

TInput

Operation input type.

TResult

Operation result type.

Sync<TInput, TResult>(Func<OperationStartContext, TInput, TResult>)

Create a synchronous (start-only) operation from the given lambda.

public static IOperationHandler<TInput, TResult> Sync<TInput, TResult>(Func<OperationStartContext, TInput, TResult> apply)

Parameters

apply Func<OperationStartContext, TInput, TResult>

Lambda that is invoked on each operation start.

Returns

IOperationHandler<TInput, TResult>

Operation handler that only supports start with synchronous response.

Type Parameters

TInput

Operation input type.

TResult

Operation result type.

WrapAsGenericHandler(object, Type)

Wrap the given handler in a generic form.

public static IOperationHandler<object?, object?> WrapAsGenericHandler(object handler, Type interfaceType)

Parameters

handler object

An instance of IOperationHandler<TInput, TResult> to wrap in a generic form.

interfaceType Type

IOperationHandler<TInput, TResult> type with its generic arguments.

Returns

IOperationHandler<object, object>

A generic wrapper of the operation handler.

WrapAsGenericHandler<TInput, TResult>(IOperationHandler<TInput, TResult>)

Wrap the given handler in a generic form.

public static IOperationHandler<object?, object?> WrapAsGenericHandler<TInput, TResult>(IOperationHandler<TInput, TResult> handler)

Parameters

handler IOperationHandler<TInput, TResult>

Handler instance to wrap in a generic form.

Returns

IOperationHandler<object, object>

A generic wrapper of the operation handler.

Type Parameters

TInput

Handler input type.

TResult

Handler output type.