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

Add util for bulk server->uids push? #421

Open
ptaoussanis opened this issue Feb 24, 2023 · 0 comments
Open

Add util for bulk server->uids push? #421

ptaoussanis opened this issue Feb 24, 2023 · 0 comments

Comments

@ptaoussanis
Copy link
Member

ptaoussanis commented Feb 24, 2023

Currently the recommended way of broadcasting an event to multiple uids is something like this:

(doseq [uid all-uids] (chsk-send! uid [:my-app/ev {:payload some-data}]))

An inefficiency in this case is that the event message will be repeatedly serialized - once for each uid.

Instead, we could easily add a simple util that:

  • Takes a coll of uids
  • Uses the active packer only once
  • Sends the packed string to all uids

This would be a substitute for [#276].

@ptaoussanis ptaoussanis changed the title Consider: new API option for bulk server->uids push Add util for bulk server->uids push? Feb 28, 2023
@ptaoussanis ptaoussanis added this to the v1.19 milestone Feb 28, 2023
@ptaoussanis ptaoussanis removed this from the v1.20 milestone Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant