npm/concurrent-couch-follower

Name: concurrent-couch-follower

Owner: npm

Description: a couch follower wrapper that you can use to be sure you don't miss any documents even if you process them asynchronously.

Created: 2015-10-22 14:34:25.0

Updated: 2018-03-10 20:38:40.0

Pushed: 2017-03-14 18:01:28.0

Homepage: null

Size: 12

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

concurrent-couch-follower

a couch follower wrapper that you can use to be sure you don't miss any documents even if you process them asynchronously.

changes = require('concurrent-couch-follower')
someAction = require(.....)

dataHandler = function(data, done) {
someAction(data, function() {
  done()
})


configOptions = {
: 'https://url.to.couchdb/registry/_changes',
clude_docs:true,
quence:'.sequence',
w:false,
ncurrency:5


ges(dataHandler, configOptions)
API
changes(handler,options)
more examples

save the sequence ids in a database.

changes = require('concurrent-couch-follower')
someAction = require(.....)

dataHandler = function(data, done) {
someAction(data, function() {
  done()
})


SequenceFromDB(function(err,sequence){
r configOptions = {
db: 'https://url.to.couchdb/registry/_changes',
include_docs:true,
sequence:function(seq,cb){
  saveInDB(seq,cb)
},
since:sequence,
concurrency:5


anges(dataHandler, configOptions)


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.