ServiceRemotingCancellationHelper Class

  • java.lang.Object
    • microsoft.servicefabric.services.remoting.runtime.ServiceRemotingCancellationHelper

public class ServiceRemotingCancellationHelper

Provides cancellation support for remote method dispatching.

Constructor Summary

Constructor Description
ServiceRemotingCancellationHelper(String traceId)

Method Summary

Modifier and Type Method and Description
CompletableFuture<byte[]> cancelRequestAsync(int interfaceId, int methodId, String callContext)

Cancels the request asynchronously.

CompletableFuture<byte[]> dispatchRequest(int interfaceId, int methodId, String callContext, Function<CancellationToken, CompletableFuture<byte[]>> dispatchFunc)

Dispatch request.

boolean isCancellationRequest(ServiceRemotingMessageHeaders messageHeaders)

Returns true if it is a cancellation request.

Constructor Details

ServiceRemotingCancellationHelper

public ServiceRemotingCancellationHelper(String traceId)

Parameters:

traceId

Method Details

cancelRequestAsync

public CompletableFuture cancelRequestAsync(int interfaceId, int methodId, String callContext)

Cancels the request asynchronously.

Parameters:

interfaceId - The interface id of the remote interface
methodId - The methodId of the remote method
callContext - callContext.

Returns:

returns a Completable future having byte array.

dispatchRequest

public CompletableFuture dispatchRequest(int interfaceId, int methodId, String callContext, Function> dispatchFunc)

Dispatch request.

Parameters:

interfaceId - The interface id of the remote interface
methodId - The methodId of the remote method
callContext - callContext.
dispatchFunc - dispatch function.

Returns:

returns a Completable future.

isCancellationRequest

public boolean isCancellationRequest(ServiceRemotingMessageHeaders messageHeaders)

Returns true if it is a cancellation request.

Parameters:

messageHeaders - Request message headers

Returns:

boolean indicating whether its cancellation request or not.

Applies to