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

Spread multiple messages for concurrency #1

Open
bradstimpson opened this issue May 7, 2017 · 2 comments
Open

Spread multiple messages for concurrency #1

bradstimpson opened this issue May 7, 2017 · 2 comments

Comments

@bradstimpson
Copy link
Contributor

No description provided.

@SGrondin
Copy link
Member

Writing to a channel should accept an array and all the messages in that array should be sent in the same call. The reason for this is that spreading those messages is something that Newque itself can do! By having only a single call to Newque, you can maximize throughput over the network. And it also lets you mark those messages as "atomic", which means that they'll only ever be written and read together (they count as one message in Newque).

To spread messages, add this to your channel's configuration file:

"writeSettings": {
  "batching": {
    "maxSize": 1,
    "maxTime": 0
  }
}

Newque has special optimizations for batching.maxSize == 0 and will spread the messages so that they are sent to the Backend one at a time in a way that's performant.

@SGrondin
Copy link
Member

After discussion with @bradstimpson I learned that this issue is to implement something similar to Axios' or Bluebird's spread functionality.

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