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

changesReader doesn't batch #298

Open
andywillis opened this issue May 25, 2022 · 0 comments
Open

changesReader doesn't batch #298

andywillis opened this issue May 25, 2022 · 0 comments

Comments

@andywillis
Copy link

andywillis commented May 25, 2022

Expected Behavior

I would expect the following code to wait 10 seconds and then return a batch of messages from the last position in the changes feed. So if I updated the DB 5 times within that 10 second timeout I would expect to see: "a batch of 5 changes has arrived" after 10 seconds.

messages.changesReader
  .start({ timeout: 10000 })
  .on('batch', (batch) => {
    console.log('a batch of', batch.length, 'changes has arrived');
  }).on('error', (e) => {
    console.error('error', e);
  });

Current Behavior

What is happening is that no batching is taking place. Every time I update the database within that timeout I immediately get the log "a batch of 1 changes has arrived".

Have I missed something obvious or misunderstood how nano's batching works?

Your Environment

  • Node v16.5
  • npm 8.5.5
  • Windows 10
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

1 participant