Skip to content
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

feat(fcm): Implement sendEach, sendEachAsync, sendEachForMulticast and sendEachForMulticastAsync (#785) #815

Merged
merged 6 commits into from
Jun 8, 2023

Commits on Jun 2, 2023

  1. feat(fcm): Implement sendEach, sendEachAsync, `sendEachForMultica…

    …st` and `sendEachForMulticastAsync` (#785)
    
    * Add org.hamcrest as dependency for unit tests
    
    * Implement sendEach, sendEachAsync, sendEachForMulticast and sendEachForMulticastAsync
    
    `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 `messagingClient.send` to send each message
        and constructs a `SendResponse` with the returned `messageId`.
        If `messagingClient.send` throws out an exception, `sendEach`
        will catch the exception and also turn it into a `SendResponse`
        with the exception in it.
        `sendEach` calls `ApiFutures.allAsList().get()` to execute all
        `messagingClient.send` calls asynchronously and wait for all of
        them to complete and construct a `BatchResponse` with all
        `SendResponse`s.
        Therefore, unlike `sendAll`, `sendEach` does not always throw
        an error for a total failure. It can also return a `BatchResponse`
        with only errors in it.
    
    `sendEachForMulticast` calls `sendEach` under the hood.
    `sendEachAsync` is the async version of `sendEach`.
    `sendEachForMulticastAsync` is the async version of `sendEachForMulticast`.
    
    * Add integration tests for batch-send re-implementation:
    testSendEach(), testSendFiveHundredWithSendEach(), testSendEachForMulticast()
    Doris-Ge authored Jun 2, 2023
    Configuration menu
    Copy the full SHA
    b90979e View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2023

  1. Configuration menu
    Copy the full SHA
    ef0bd81 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    68f5350 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ee89153 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2023

  1. Address doc review comments

    Doris-Ge committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    b42287a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bc960b1 View commit details
    Browse the repository at this point in the history