Re: Examples of Async Restful services

Shaunak Kashyap <[email protected]> Wed, 8 May 2013 04:26:41 -0700
Newsgroups gmane.comp.web.services.rest
Message-ID <[email protected]>
In this case, I would still return a 202 Accepted (to indicate asynchronous processing). As for how the result of this processing is conveyed to the client, it could be a via a poll from the client (as you suggest) or a callback to the client (as in the Twilio example) or even both. I'm not sure if the callback approach is necessarily in conflict with the RESTfulness of the API but I'd love to hear more about that from the list.

Shaunak

On May 8, 2013, at 3:32 AM, Unmesh Joshi <[email protected]> wrote:

> hmm interesting. In general I would expect Restful API to return a URL as reponse to 202 or 201 where client can poll. Accepting a URl to push response doesnt fit that.
> 
> 
> On Wed, May 8, 2013 at 3:24 PM, Shaunak Kashyap <[email protected]> wrote:
> Hi Unmesh,
> 
> This may not be exactly what you are looking for but see http://www.twilio.com/docs/api/rest/sending-sms. This API lets an application send an SMS. Twilio's backend perfoms the actual sending of the SMS asynchronously with the API call.
> 
> The API takes as an optional parameter a StatusCallback URI. This is a URI from your application; Twilio will POST to this URI when it has sent (or tried to send) the SMS.
> 
> Hope that helps,
> 
> Shaunak
> 
> --- In [email protected], Unmesh Joshi <unmeshjoshi@...> wrote:
> >
> > Hi,
> >
> > There are certain situations where modelling services as async is better
> > choice. One of the reasons can be to limit load on the backend services or
> > databases if the requests involve heavy processing.
> > Restful way of creating these services is to return 202 accepted with a URL
> > to poll the result or status of the request.
> > While I have read about and seen text book examples of this approach, I
> > don't know of any real life good examples of this. Can someone point me to
> > a good example?
> >
> > Thanks,
> > Unmesh
> >
> 
> 
>