Share via


JobTerminatePollerAsync Class

  • java.lang.Object
    • com.azure.compute.batch.JobTerminatePollerAsync

public final class JobTerminatePollerAsync

Async poller class used by beginTerminateJob to implement polling logic for terminating a BatchJob. Returns BatchJob values during polling and as the final result.

Constructor Summary

Constructor Description
JobTerminatePollerAsync(BatchAsyncClient batchAsyncClient, String jobId, RequestOptions options)

Creates a new JobTerminatePollerAsync.

Method Summary

Modifier and Type Method and Description
Function<PollingContext<BatchJob>,Mono<PollResponse<BatchJob>>> getActivationOperation()

Activation operation to start the termination.

BiFunction<PollingContext<BatchJob>,PollResponse<BatchJob>,Mono<BatchJob>> getCancelOperation()

Cancel operation (not supported for terminate).

Function<PollingContext<BatchJob>,Mono<BatchJob>> getFetchResultOperation()

Final result fetch operation.

Function<PollingContext<BatchJob>,Mono<PollResponse<BatchJob>>> getPollOperation()

Poll operation to check the job's termination state.

Methods inherited from java.lang.Object

Constructor Details

JobTerminatePollerAsync

public JobTerminatePollerAsync(BatchAsyncClient batchAsyncClient, String jobId, RequestOptions options)

Creates a new JobTerminatePollerAsync.

Parameters:

batchAsyncClient - The BatchAsyncClient used to interact with the Batch service.
jobId - The ID of the Job being terminated.
options - Optional request options for service calls.

Method Details

getActivationOperation

public Function<PollingContext<BatchJob>,Mono<PollResponse<BatchJob>>> getActivationOperation()

Activation operation to start the termination.

Returns:

A function that initiates the terminate request and returns a PollResponse<T> with LongRunningOperationStatus#IN_PROGRESS status.

getCancelOperation

public BiFunction<PollingContext<BatchJob>,PollResponse<BatchJob>,Mono<BatchJob>> getCancelOperation()

Cancel operation (not supported for terminate).

Returns:

A function that always returns an empty Mono, indicating cancellation is unsupported.

getFetchResultOperation

public Function<PollingContext<BatchJob>,Mono<BatchJob>> getFetchResultOperation()

Final result fetch operation.

Returns:

A function that fetches the final BatchJob after successful termination.

getPollOperation

public Function<PollingContext<BatchJob>,Mono<PollResponse<BatchJob>>> getPollOperation()

Poll operation to check the job's termination state.

Returns:

A function that polls the job and returns a PollResponse<T> with the current LongRunningOperationStatus.

Applies to