Skip to content
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

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

jeremymeng
Copy link
Member

also add a testPollingOptions in recorder to help testing in playback mode.

also add a `testPollingOptions` in recorder to help testing in playback mode.
@github-actions github-actions bot added the App Configuration Azure.ApplicationModel.Configuration label Sep 21, 2023
@jeremymeng
Copy link
Member Author

I am a little surprised that this LRO option doesn't have our standard options?

@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-app-configuration

* Polling options that don't wait in playback mode.
*/
export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
Copy link
Member

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.

Copy link
Member Author

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...

Copy link
Member Author

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;
Copy link
Member

@HarshaNalluru HarshaNalluru Sep 21, 2023

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?

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member Author

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

Copy link
Member

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?

Copy link
Member

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.

@jeremymeng jeremymeng merged commit eb233b4 into Azure:main Sep 21, 2023
26 checks passed
@jeremymeng jeremymeng deleted the appconf/add-updateinterval branch September 21, 2023 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Azure.ApplicationModel.Configuration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants