ICancellationStrategy Interface

Definition

Defines an extensibility point by which RPC methods may be canceled using CancellationToken.

public interface ICancellationStrategy
type ICancellationStrategy = interface
Public Interface ICancellationStrategy

Remarks

A cancellation strategy can be set on the CancellationStrategy property.

The default implementation is defined by StreamJsonRpc.StandardCancellationStrategy.

Implementations must be thread-safe.

Methods

CancelOutboundRequest(RequestId)

Translates a canceled CancellationToken that was used in an outbound RPC request into terms that the RPC server can understand.

IncomingRequestEnded(RequestId)

Cleans up any state associated with an earlier IncomingRequestStarted(RequestId, CancellationTokenSource) call.

IncomingRequestStarted(RequestId, CancellationTokenSource)

Associates the RequestId from an incoming request with the CancellationTokenSource that is used for the CancellationToken passed to that RPC method so it can be canceled later.

OutboundRequestEnded(RequestId)

Cleans up any state associated with an earlier CancelOutboundRequest(RequestId) call.

Applies to