Oneway and async operations

Hi, I’m trying to understand if it makes sense to implemented such a a operation implementation:

  1. The operation is bit long task so I wanted to spin a new thread and return the control to the client “immediately”
  2. The task requires the httpcontext

I tried to wrap the implementation in a Task.Factory.StartNew , passing the httpcontext. unfortunately the httpcontext. is reset (httpcontext.items is emptied) after the http call is over event if the spinned thread is stlil working (which males sense actually).

Is there anyway I could achieve what I need … or I’ll have to give the responsability to the client to do an async http request ?

thank you

When you start a background thread you would pass it whatever state you need, it doesn’t let you access the current HTTP Context by design since it’s not the same HTTP Worker Request thread.

But if you just want responsiveness on the client the right way for them to do it is to make a non-blocking async request.