Ask A Question

Notifications

You’re not receiving notifications from this thread.

Handle "delayed" response from external API

Michael asked in General

I have been following the series on building a gem using Faraday against the Vultr API and have started building my own version of it against one of the Azure dataplane API's. This works a little bit differently, in the sense that for every action (create, update and delete) you get an immediate response with an operationId, which you then have to poll, to get the status of the operation ("in progress", "succeded", "failed" etc.), and if it failed, you will also get the error message.

I have never tried to work with such a scenario before, so I would appreciate some input on how you would handle this. I imagine that in the application, where the gem will eventually end up being used, the form for creating a ressource, only returns once the status is "succeded" / "failed".

In short, how should I approach this? Should it be handled in the gem or the application? And how?

I really appreciate any input on this - thanks!

Reply

ReportsInsights 

Reply

reportsinsights.com

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.