You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/05/25 15:39:49 UTC

[GitHub] [couchdb-nano] andywillis opened a new issue, #298: `changesReader` doesn't batch

andywillis opened a new issue, #298:
URL: https://github.com/apache/couchdb-nano/issues/298

   <!--- Provide a general summary of the issue in the Title above -->
   
   ## Expected Behavior
   
   I would expect the following to batch new additions to the messages database every 10 seconds. 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"
   
   ```
     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, and every time I update the database I _immediately_ get the log "a batch of 1 changes has arrived".
   
   ## Context
   
   Eventually I want to set up a websocket on the front-end to use that batched data, but I need to figure this part out first. I may just have misunderstood how batching works. Any pointers to help resolve this would be great.
   
   ## Your Environment
   
   * Node v16.5
   * npm 8.5.5
   * Windows 10


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org