Table of Contents

Class Handler

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll

Primary Handler implementation that works with a collection of ServiceHandlerInstances, a serializer, and middleware.

public class Handler : IHandler
Inheritance
Handler
Implements
Inherited Members

Constructors

Handler(ICollection<ServiceHandlerInstance>, ISerializer)

Initializes a new instance of the Handler class.

public Handler(ICollection<ServiceHandlerInstance> instances, ISerializer serializer)

Parameters

instances ICollection<ServiceHandlerInstance>

Service instances. Cannot have duplicates for the same service name.

serializer ISerializer

Serializer to use.

Handler(ICollection<ServiceHandlerInstance>, ISerializer, IReadOnlyCollection<IOperationMiddleware>)

Initializes a new instance of the Handler class.

public Handler(ICollection<ServiceHandlerInstance> instances, ISerializer serializer, IReadOnlyCollection<IOperationMiddleware> middlewares)

Parameters

instances ICollection<ServiceHandlerInstance>

Service instances. Cannot have duplicates for the same service name.

serializer ISerializer

Serializer to use.

middlewares IReadOnlyCollection<IOperationMiddleware>

Middleware to apply.

Methods

CancelOperationAsync(OperationCancelContext)

Request operation cancel.

public Task CancelOperationAsync(OperationCancelContext context)

Parameters

context OperationCancelContext

Context.

Returns

Task

Task when cancel has been sent.

Exceptions

HandlerException

Unexpected handler failure.

FetchOperationInfoAsync(OperationFetchInfoContext)

Fetch operation info.

public Task<OperationInfo> FetchOperationInfoAsync(OperationFetchInfoContext context)

Parameters

context OperationFetchInfoContext

Context.

Returns

Task<OperationInfo>

Task with operation info.

Exceptions

HandlerException

Unexpected handler failure.

FetchOperationResultAsync(OperationFetchResultContext)

Fetch operation result, waiting if necessary.

public Task<HandlerContent> FetchOperationResultAsync(OperationFetchResultContext context)

Parameters

context OperationFetchResultContext

Context.

Returns

Task<HandlerContent>

Task with result contents.

Exceptions

OperationStillRunningException

Operation still running (after optional wait).

OperationException

Operation failed.

HandlerException

Unexpected handler failure.

StartOperationAsync(OperationStartContext, HandlerContent)

Start operation.

public Task<OperationStartResult<HandlerContent>> StartOperationAsync(OperationStartContext context, HandlerContent input)

Parameters

context OperationStartContext

Context.

input HandlerContent

Operation input.

Returns

Task<OperationStartResult<HandlerContent>>

Task with sync or async result.

Exceptions

OperationException

Operation failed.

HandlerException

Unexpected handler failure.