-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fcm): SendEach and SendEachForMulticast for FCM batch send (#552)
* 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
- Loading branch information
Showing
3 changed files
with
724 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.