-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[AppConfig] allow setting updateIntervalInMs
in LRO options
#27200
Conversation
also add a `testPollingOptions` in recorder to help testing in playback mode.
I am a little surprised that this LRO option doesn't have our standard options? |
API change check APIView has identified API level changes in this PR and created following API reviews. |
* Polling options that don't wait in playback mode. | ||
*/ | ||
export const testPollingOptions = { | ||
updateIntervalInMs: isPlaybackMode() ? 0 : 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.
NIT
we can import the type from core-lro, so that they are in sync always.
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.
core-lro's LroEngineOptions has a different property intervalInMs
, which means some other packages needs a different testing option...
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.
we can add intervalInMs: isPlaybackMode() ? 0 : undefined,
here too when needed in the future, it should be compatible with both.
/** | ||
* The amount of time to wait (in milliseconds) between subsequent requests relating to the same operation. | ||
*/ | ||
updateIntervalInMs?: number; |
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.
beginCreateSnapshot()
in the generated code takes this CreateSnapshotOptionalParams
as the options bag, unsure how this fell off.
export interface CreateSnapshotOptionalParams
extends coreClient.OperationOptions {
/** Delay to wait until next poll, in milliseconds. */
updateIntervalInMs?: number;
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
resumeFrom?: string;
}
updateIntervalInMs
makes sense.
resumeFrom
- I'm not sure about. Should we skip this? Who pauses the operation? service pauses it and we resume it? How is this typically used?
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.
Maybe it is supported by codegen but I have not tested resumeFrom
so didn't add it this time.
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.
Let's merge the PR anyway since it is unrelated.
@deyaaeldeen if you can shed some light on resumeFrom
... we can take it in another PR
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.
I think the idea is that you serialize the current poller state to a string, then later you can resume by rehydrating the state
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.
resumeFrom
is a string-representation of the poller's state. For instance, the client can decide to serialize the poller state and send it over somewhere else and do polling there instead. I personally don't like it too much because it is an option and you still have to provide required inputs to the method anyway?
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.
Also, it is supported in all core-lro's pollers.
also add a
testPollingOptions
in recorder to help testing in playback mode.