-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HttpLongRunningOperationResponse #46
Conversation
} | ||
} | ||
|
||
export function createHttpLongRunningOperationResponseFromInitialResponse(azureServiceClient: AzureServiceClient, initialResponse: HttpOperationResponse, options?: RequestOptionsBase): HttpLongRunningOperationResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What makes export
necessary for these 2 functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two functions serve as the constructor functions for HttpLongRunningOperationResponse objects. They're both used by the AzureServiceClient class.
} else { | ||
throw new Error("Can't determine long running operation polling strategy from initial response."); | ||
result = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it ever make sense to hit this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line shouldn't ever be hit if all of our services properly follow the LRO specifications, but if they do something that is unexpected or if the initial response indicates that the operation has already completed, then this line will be hit.
Is there any need to bump the minor version before publishing? |
Not yet. There weren't any breaking changes in this PR. Just additive changes. |
Resolves Azure/azure-sdk-for-node#2871 (partially).
This PR adds the HttpLongRunningOperationResponse type to ms-rest-azure-js. This is the public facing polling object that encapsulates the complexity of the LROPollStrategy types and exposes a nicer facade that customers can work with. It enables customers to get the current status of their LRO, to do a single poll, to poll until the LRO is finished, or to get a memento of the LRO that can be saved to disk or sent across the network. This memento can later be used to restore the HttpLongRunningOperationStatus and continue polling.