IAsyncResult IWcfService <TRequest, TResponse> .BeginProcess(TRequest request, AsyncCallback callback, object state) { var result = new ServiceAsyncResult(state); Log.WarnFormat("Doing SendLocal with Callback!"); return(((UnicastBus)bus).SendLocal(request).Register(r => ProxyCallback(callback, result, r), state)); }
private static void ProxyCallback(AsyncCallback callback, ServiceAsyncResult result, IAsyncResult busResult) { var completionResult = (CompletionResult)busResult.AsyncState; result.Complete(completionResult); callback(result); }
IAsyncResult IWcfService <TRequest, TResponse> .BeginProcess(TRequest request, AsyncCallback callback, object state) { var result = new ServiceAsyncResult(state); return(bus.SendLocal(request).Register(r => ProxyCallback(callback, result, r), state)); }