SendEachAsync sends one HTTP request to V1 Send endpoint for each message in the list. SendAllAsync sends only one HTTP request to V1 Batch Send endpoint to send all messages in the list.
SendEachAsync calls Task.WhenAll to wait for all httpClient.SendAndDeserializeAsync calls to complete and construct a BatchResponse with all SendResponses. An httpClient.SendAndDeserializeAsync call to V1 Send endpoint either completes with a success or throws an exception. So if an exception is thrown out, the exception will be caught in SendEachAsync and turned into a SendResponse with an exception. Therefore, unlike SendAllAsync, SendEachAsync does not always throw an exception for a total failure. It can also return a BatchResponse with only exceptions in it.
SendEachForMulticastAsync calls SendEachAsync under the hood.
SendEachAsync
vsSendAllAsync
SendEachAsync
sends one HTTP request to V1 Send endpoint for each message in the list.SendAllAsync
sends only one HTTP request to V1 Batch Send endpoint to send all messages in the list.SendEachAsync
callsTask.WhenAll
to wait for allhttpClient.SendAndDeserializeAsync
calls to complete and construct aBatchResponse
with allSendResponse
s. AnhttpClient.SendAndDeserializeAsync
call to V1 Send endpoint either completes with a success or throws an exception. So if an exception is thrown out, the exception will be caught inSendEachAsync
and turned into aSendResponse
with an exception. Therefore, unlikeSendAllAsync
,SendEachAsync
does not always throw an exception for a total failure. It can also return aBatchResponse
with only exceptions in it.SendEachForMulticastAsync
callsSendEachAsync
under the hood.