异步调用服务操作时:
proxy.OperationCompleted += new EventHandler<OperationEventArgs>(OperationCallback);
proxy.OperationAsync(OperationRequest request);
在服务器端:
new Thread(new ThreadStart(RunOperations)).Start();
public OperationResponse Operation(OperationRequest request)
{
Queue.Enqueue(request);
}
// in some other thread
public OperationResponse RunOperations()
{
OperationRequest request = Queue.Dequeue();
OperationResponse response = Execute(request);
// here i need to some how return to response to the threw the channel
// which sent the request
}
我的问题 :
有没有办法不构造双工通道并通过回调返回响应,引用提交通道并返回响应抛出它?