public Task WriteAsync(TResponse message) { var taskSource = new AsyncCompletionTaskSource <object>(); call.StartSendMessage(message, GetWriteFlags(), taskSource.CompletionDelegate); return(taskSource.Task); }
public void OnNext(TResponse value) { var taskSource = new AsyncCompletionTaskSource(); call.StartSendMessage(value, taskSource.CompletionDelegate); // TODO: how bad is the Wait here? taskSource.Task.Wait(); }