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:
- webapi receives http request callback url.
- webapi handles url , if operation completes in less time configured timeout result sent synchronously.
- if timeout exceeded server needs send http response indicating went async, processing continues.
- 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
Post a Comment