-
Notifications
You must be signed in to change notification settings - Fork 2.2k
mgmt, support begin operation with syncpoll #12141
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
mgmt, support begin operation with syncpoll #12141
Conversation
| while (pollResponse.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { | ||
| SdkContext.sleep(1000); | ||
| pollResponse = acceptedDeployment.getSyncPoller().poll(); | ||
| } |
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.
Support polling by user.
| * | ||
| * @return the final result. | ||
| */ | ||
| T getFinalResult(); |
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.
Plan is to make this call return the resource, after LRO and after all following-up operations finished.
| } | ||
|
|
||
| @Override | ||
| public PollResponse<Void> poll() { |
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.
Next plan is to give a concrete class for this current Void in PollResponse, to provide more information about the poll, e.g. poll url, response body, etc.
But that would require more changes in core-management, so it would likely be delayed to another PR.
Currently, try replace
Deployment.beginCreateandResourceGroups.beginDeletewith this approach.Note that there is case which is much more complicated than this, those with dependency resources need to be created before LRO, and following-up operation after LRO.