c# - How would I extend WebAPI to support returning controller action results via an HTTP callback? -


i'm trying extend webapi support returning response through http callback.

workflow:

  1. webapi receives http request callback url.
  2. webapi handles url , if operation completes in less time configured timeout result sent synchronously.
  3. if timeout exceeded server needs send http response indicating went async, processing continues.
  4. when processing (eventually) completes response of controller posted pre-negotiated callback url.

controllers need remain synchronous , unaware of async/callback functionality.

it appears messagehandlers candidate returning multiple http responses (one 'long task' response , 1 callback) not appear supported.

can provide guidance on areas of webapi extensible , relevant scenario?

i think httpmessagehandler trick not way think you're asking for.

one url main 1 , return either result or redirection , other handle redirections.

this common scenario. in cases you'll ask list of , receive managed amount of results , continuation url if there more. requirement might looked being either have continuation or whole results.

another way of looking @ cqrs (command query responsibility segregation). issue command on url , retrieve response another. optimization, result of invoking command might response instead of query url.

does you?


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -