0.1.14 • Published 9 years ago

couchtap v0.1.14

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

CouchTAP

Install

npm install couchtap

Introduction

This is a CouchBase TAP client implementation for node.js. This is a WIP, full javascript implementation.

The TAP protocol allows you to be notified when events occurs in your couchbase buckets.

Here is a basic exemple:

var tap  = require('couchtap')
var wire = new tap.Client({
  name:     'test1',
  host:     'vm-ubuntu',
  bucket:   'test',
  password: 'password',
});
wire.on('connect', function() {
  wire.setMode({
    backfill : -1,  // Require backfill for future events
    onlyKeys : true // Get only keys (the server might ignore this) 
  })
})
wire.connect();

Or if you want the connection and mode setup to happen automagically:

var tap  = require('couchtap')
var wire = new tap.Client({
  name:     'test1',
  connect:  true,
  host:     'vm-ubuntu',
  bucket:   'test',
  password: 'password',
  mode:     {
    dump : true, // Dump all documents
  }
});

Then listen to events :

wire.on('mutation', function(meta, key, body, misc) {
  console.log('The document ', key, ' just changed');
})

wire.on('delete', function(meta, key, misc) {
  console.log('The document ', key, ' was deleted');
})

wire.on('flush', function(misc) {
  console.log('The bucket was flushed');
})

wire.on('opaque', function(flags, misc) {
  console.log('Opaque frame with flags:', flags);
})

Documentation

There is none at the moment, just refer to the couchbase wiki page on TAP Protocol

TODO

  • Handle vBucket, Checkpoint responses
  • vBucket related features testing
  • Write tests
  • Write documentation
  • A lot of other stuffs
0.1.14

9 years ago

0.1.13

9 years ago

0.1.12

10 years ago

0.1.11

10 years ago

0.1.10

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago