public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) { var task = Task.Factory.StartNew(() => _invoker.Invoke(_arguments, _routeData)); task.ContinueWith(x => cb(task)); return(task); }
public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback cb, object extraData) { var exceptionHandlingObserver = new ExceptionHandlingObserver(); _arguments.Set(typeof(IExceptionHandlingObserver), exceptionHandlingObserver); var task = Task.Factory.StartNew(state => _invoker.Invoke(_arguments, _routeData), exceptionHandlingObserver); task.ContinueWith(x => cb(x)); return(task); }
public IAsyncResult BeginProcessRequest(System.Web.HttpContext context, AsyncCallback cb, object extraData) { var taskCompletionSource = new TaskCompletionSource <object>(); var requestCompletion = new RequestCompletion(); requestCompletion.WhenCompleteDo(ex => { if (ex != null) { taskCompletionSource.SetException(ex); } taskCompletionSource.SetResult(null); cb(taskCompletionSource.Task); }); requestCompletion.Start(() => _invoker.Invoke(_arguments, _routeData, requestCompletion)); return(taskCompletionSource.Task); }
public void ProcessRequest(System.Web.HttpContext context) { var requestCompletion = new RequestCompletion(); requestCompletion.Start(() => _invoker.Invoke(_arguments, _routeData, requestCompletion)); }
public void ProcessRequest(HttpContext context) { _invoker.Invoke(_arguments, _routeData); }
public IAsyncResult BeginProcessRequest(System.Web.HttpContext context, AsyncCallback cb, object extraData) { return(_invoker.Invoke(_arguments, _routeData)); }