lib/changes_pool.js
function (db, query, callback) {
    // query parameter is optional
    if (!callback) {
      callback = query
      query = {}
    }

    // create a new request object
    var req = {
      // db name
      db: db,
      // authenticated url to db
      db_url: url.resolve(couch_url, encodeURIComponent(db)),
      // used by the update queue workers
      callback: callback,
      // store the query parameters
      query: query
    }

    // make sure the request has a since parameter set
    exports.updateSince(req, function (err, req) {
      if (err) {
        return callback(err)
      }

      // add the changes request to the pool
      exports.addToPool(idle, req)
    // queue the new request for immediate update
    // exports.refreshDB(updated, idle, db)
    })
  }
function (db, query, callback) {
    // query parameter is optional
    if (!callback) {
      callback = query
      query = {}
    }

    // create a new request object
    var req = {
      // db name
      db: db,
      // authenticated url to db
      db_url: url.resolve(couch_url, encodeURIComponent(db)),
      // used by the update queue workers
      callback: callback,
      // store the query parameters
      query: query
    }

    // make sure the request has a since parameter set
    exports.updateSince(req, function (err, req) {
      if (err) {
        return callback(err)
      }

      // add the changes request to the pool
      exports.addToPool(idle, req)
    // queue the new request for immediate update
    // exports.refreshDB(updated, idle, db)
    })
  }
function ( db , query , callback ) { // query parameter is optional if ( ! callback ) { callback = query query = { } } // create a new request object var req = { // db name db : db , // authenticated url to db db_url : url . resolve ( couch_url , encodeURIComponent ( db ) ) , // used by the update queue workers callback : callback , // store the query parameters query : query } // make sure the request has a since parameter set exports . updateSince ( req , function ( err , req ) { if ( err ) { return callback ( err ) } // add the changes request to the pool exports . addToPool ( idle , req ) // queue the new request for immediate update // exports.refreshDB(updated, idle, db) } ) }
the public changes feed subscription function
the public changes feed subscription function