-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement SendEach
, SendEachDryRun
, SendEachForMulticast
,
#544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Doris-Ge ! Looks great.
Please make sure that this branch is based off of |
|
`SendEachForMulticastDryRun` 1. Add `SendEach`, `SendEachDryRun`, `SendEachForMulticast`, `SendEachForMulticastDryRun` 2. Deprecate `SendAll`, `SendAllDryRun`, `SendMulticast`, `SendMulticastDryRun` `SendEach` vs `SendAll` 1. `SendEach` sends one HTTP request to V1 Send endpoint for each message in the array. `SendAll` sends only one HTTP request to V1 Batch Send endpoint to send all messages in the array. 2. `SendEach` calls fcmClient.Send to send each message and constructs a SendResponse with the returned message id or error. `SendEach` uses sync.WaitGroup to execute all fcmClient.Send calls asynchronously and wait for all of them to complete and construct a BatchResponse with all SendResponses. Therefore, unlike `SendAll`, `SendEach` does not always returns an error for a total failure. It can also return a `BatchResponse` with only errors in it. `SendEachForMulticast` calls `SendEach` under the hood.
9d24429
to
4ffa38f
Compare
`SendEachForMulticastDryRun` 1. Add `SendEach`, `SendEachDryRun`, `SendEachForMulticast`, `SendEachForMulticastDryRun` 2. Deprecate `SendAll`, `SendAllDryRun`, `SendMulticast`, `SendMulticastDryRun` `SendEach` vs `SendAll` 1. `SendEach` sends one HTTP request to V1 Send endpoint for each message in the array. `SendAll` sends only one HTTP request to V1 Batch Send endpoint to send all messages in the array. 2. `SendEach` calls fcmClient.Send to send each message and constructs a SendResponse with the returned message id or error. `SendEach` uses sync.WaitGroup to execute all fcmClient.Send calls asynchronously and wait for all of them to complete and construct a BatchResponse with all SendResponses. Therefore, unlike `SendAll`, `SendEach` does not always returns an error for a total failure. It can also return a `BatchResponse` with only errors in it. `SendEachForMulticast` calls `SendEach` under the hood.
* Implement `SendEach`, `SendEachDryRun`, `SendEachForMulticast`, (#544) `SendEachForMulticastDryRun` 1. Add `SendEach`, `SendEachDryRun`, `SendEachForMulticast`, `SendEachForMulticastDryRun` 2. Deprecate `SendAll`, `SendAllDryRun`, `SendMulticast`, `SendMulticastDryRun` `SendEach` vs `SendAll` 1. `SendEach` sends one HTTP request to V1 Send endpoint for each message in the array. `SendAll` sends only one HTTP request to V1 Batch Send endpoint to send all messages in the array. 2. `SendEach` calls fcmClient.Send to send each message and constructs a SendResponse with the returned message id or error. `SendEach` uses sync.WaitGroup to execute all fcmClient.Send calls asynchronously and wait for all of them to complete and construct a BatchResponse with all SendResponses. Therefore, unlike `SendAll`, `SendEach` does not always returns an error for a total failure. It can also return a `BatchResponse` with only errors in it. `SendEachForMulticast` calls `SendEach` under the hood. * Add integration tests for `SendEach` and `SendEachForMulticast` (#550) * Avoid using "-- i.e." in the function comments * Remove all backticks in messaging_batch.go
SendEachForMulticastDryRun
SendEach
,SendEachDryRun
,SendEachForMulticast
,SendEachForMulticastDryRun
SendAll
,SendAllDryRun
,SendMulticast
,SendMulticastDryRun
SendEach
vsSendAll
SendEach
sends one HTTP request to V1 Send endpoint for each message in the array.SendAll
sends only one HTTP request to V1 Batch Send endpoint to send all messages in the array.SendEach
calls fcmClient.Send to send each message and constructs a SendResponse with the returned message id or error.SendEach
uses sync.WaitGroup to execute all fcmClient.Send calls asynchronously and wait for all of them to complete and construct a BatchResponse with all SendResponses. Therefore, unlikeSendAll
,SendEach
does not always returns an error for a total failure. It can also return aBatchResponse
with only errors in it.SendEachForMulticast
callsSendEach
under the hood.Will send the integration tests in another PR.