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

Batch sending #22

Closed
santimacia opened this issue Jun 7, 2016 · 1 comment
Closed

Batch sending #22

santimacia opened this issue Jun 7, 2016 · 1 comment

Comments

@santimacia
Copy link
Contributor

How can I send a 1000 push different notification to a different users at the same time efficiently? For the same message I guess I can use the publish topic but if are different?

@evanshortiss
Copy link
Owner

You can use the topic features of SNS, or do something like this:

function doSend (user, next) {
  // Assume user is a user entry from a db
  // Assume sns is a valid sns instance created earlier
  sns.sendMessage(user.endpointArn, 'Hi There!', next);
}

function done (err) {
  console.log('finsihed sending to all users');
}

async.each(userList, doSend, done);

@santimacia, since this does not appear to be an issue with the module I'll close this. Feel free to reopen if you think otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants