In WCF you have something like this
[ServiceContract]
public interface IDoAuditService
{
[OperationContract(IsOneWay = true)]
[WebInvoke]
void Audit(AuditEntry auditEntry);
}
Which as a result will allow the consumers to issue a request and continuing the flow without waiting for a response.
I've tried Asp.net MVC with AsyncController but the consumer will still block and wait until the callback will be called in the controller.
What I want is to use Asp.Net MVC but the behavior WCF like, I want to issue a request and continue the flow without waiting the request to be processed
What about performing the action body async on the server and just returning to the caller immediately. It's not exactly a fire and forget but it will emulate that.
public ActionResult MyAction()
{
var workingThread = new Thread(OperationToCallAsync);
workingThread.Start();
return View();
}
void OperationToCallAsync()
{
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With