Skip to content

Commit

Permalink
Remove the method cancelOperation
Browse files Browse the repository at this point in the history
Remove this because maps-search's lro doesn't support cancelation.
For future lro that support cancelation, we should use the `createHttpPoller`
like the one in the [ai-language-text](https://github.com/Azure/azure-sdk-for-js/blob/cb198d21c4f377e9d2d57744523b8eb3f45a2fb6/sdk/cognitivelanguage/ai-language-text/src/textAnalysisClient.ts#L686)
  • Loading branch information
andykao1213 committed Sep 30, 2022
1 parent 01f4e60 commit 1de07d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions sdk/maps/maps-common/review/maps-common.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ import { PollerLike } from '@azure/core-lro';
import { PollOperationState } from '@azure/core-lro';

// @public
export interface BatchPoller<TBatchResult> extends PollerLike<PollOperationState<TBatchResult>, TBatchResult> {
export interface BatchPoller<TBatchResult> extends Omit<PollerLike<PollOperationState<TBatchResult>, TBatchResult>, "cancelOperation"> {
}

// @public
export class BatchPollerProxy<TBatchResult, TInternalBatchResult> implements BatchPoller<TBatchResult> {
constructor(internalPoller: PollerLike<PollOperationState<TInternalBatchResult>, TInternalBatchResult>, mapper: (res: TInternalBatchResult) => TBatchResult);
// (undocumented)
cancelOperation(options?: {
abortSignal?: AbortSignalLike;
}): Promise<void>;
// (undocumented)
getOperationState(): PollOperationState<TBatchResult>;
// (undocumented)
getResult(): TBatchResult | undefined;
Expand Down
6 changes: 1 addition & 5 deletions sdk/maps/maps-common/src/models/pollers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { AbortSignalLike } from "@azure/abort-controller";

/** Batch operation poller interface */
export interface BatchPoller<TBatchResult>
extends PollerLike<PollOperationState<TBatchResult>, TBatchResult> {}
extends Omit<PollerLike<PollOperationState<TBatchResult>, TBatchResult>, "cancelOperation"> {}

/**
* Batch operation poller proxy
Expand All @@ -26,10 +26,6 @@ export class BatchPollerProxy<TBatchResult, TInternalBatchResult>
await this.internalPoller.poll(options);
}

public async cancelOperation(options: { abortSignal?: AbortSignalLike } = {}): Promise<void> {
await this.internalPoller.cancelOperation(options);
}

public async pollUntilDone(): Promise<TBatchResult> {
const result = await this.internalPoller.pollUntilDone();
return this.mapper(result);
Expand Down

0 comments on commit 1de07d2

Please sign in to comment.