假设我打电话
AsyncCallback callback = new AsyncCallback(QueueMessageAdded);
queue.BeginAddMessage(new CloudQueueMessage(message), callback, null);
QueueMessageAdded
在哪里
private static void QueueMessageAdded(IAsyncResult result)
{
queue.EndAddMessage(result);
}
EndAddMessage做什么?
包括等待所有回调被调用,它和调用同步版本一样慢:
Parallel.ForEach(messages, message => queue.AddMessage(message));