Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Add support to pause, resume and get current status of polling in an LRO #2871

Closed
amarzavery opened this issue May 17, 2018 · 0 comments · Fixed by Azure/ms-rest-azure-js#46

Comments

@amarzavery
Copy link
Contributor

The two requirements are:

  1.  Ability to initiate a LRO ApiCall and return result as soon as initial http response arrives.
    
  2.  Ability to pause and resume the LRO polling
    

Today our SDKs expose "Begin[Operation]Async" variant which address #1. Where we are lacking is, a way to transform return value of #1 so that it can be used for #2 (to resume/pause polling).

As we all know there are various way to accomplish this. For instance, In Java runtime v1, the "Begin[Operation]Async" returns Single<PollingState>, the runtime expose another method "PollOnceAsync (PollingState state)" which poll once and return Single<PollingState> that contains the latest polling state. [In Java Single is somewhat similar to C# Task or Node.js promise, there are differences but let's keep it simple in this discussion].

In python SDK, we have the concept of LRO Poller, which expose methods to start an LRO, check LRO is done or in progress, wait for LRO to finish (with an optional timeout). Laurent is also enabling custom poller.

Go SDK also has a variant this, which use Future. I’m not sure about “pausing” support though.

One advise from @anuchandy who implemented this in Java is - approaching this problem with a serializable and re-hydratable Polling State in mind enables us to coming up with a design which is loosely coupled. This will also enable us to share polling state between SDKs. For instance we can start LRO in Java and continue polling using python/cli or the TS sdk in the browser.

@ghost ghost modified the milestones: Sprint-120, Sprint-119 May 21, 2018
@ghost ghost assigned RikkiGibson May 25, 2018
@ghost ghost added the Planned-Sprint-119 label May 29, 2018
@ghost ghost modified the milestones: Sprint-119, Sprint-120 Jun 11, 2018
@ghost ghost added the Planned-Sprint-120 label Jun 11, 2018
@ghost ghost added Planned-Sprint-121 and removed stretch goal labels Jul 9, 2018
@ghost ghost modified the milestones: Sprint-120, Sprint-121 Jul 9, 2018
@ghost ghost assigned ghost and unassigned RikkiGibson Jul 9, 2018
@ghost ghost modified the milestones: Sprint-121, Sprint-122 Jul 31, 2018
@ghost ghost removed the in progress label Aug 15, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants