Skip to content

defstream/rihawk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CURRENTLY IN PROGRESS

Rihawk 0.0.9

A streaming riakpbc wrapper with advanced features.

#API

new Rihawk(options)

Returns a new instance of the Rihawk client.

parameters:

returns: a new instance of the Rihawk client.

var Rihawk = require('rihawk');

var client = new Rihawk({
  host: '127.0.0.1',
  port: 8087,
  connectTimeout: 1000,
  idleTimeout: 30000,
  maxLifetime: 500000,
  minConnections: 3,
  maxConnections: 12,
  parseValues: true
});

client.get(bucket, key, options)

parameters:

  • bucket: A string, or an array of strings containing the bucket to query.
  • key: A string, or an array of strings containing keys to return values for.
  • options: The options for the RiakPBC request.

returns: a readable stream emitting data events for each found value.

get(bucket, key, options)

var request = client.get('nfl_team', 'CHI')
.on('data', function(data) {
  console.log('#DATA', data);
})
.on('error', function(error) {
  console.log('#ERROR', error);
}).on('end', function() {
  console.log('#END');
});

get(bucket, [key], options)

var request = client.get('nfl_team', ['CHI', 'MIA', 'SD'])
.on('data', function(data) {
  console.log('#DATA', data);
})
.on('error', function(error) {
  console.log('#ERROR', error);
}).on('end', function() {
  console.log('#END');
});

get([bucket], [key], options)

var request = client.get(['nfl_team', 'baseball_team'], ['CHI', 'MIA', 'SD'])
.on('data', function(data) {
  console.log('#DATA', data);
})
.on('error', function(error) {
  console.log('#ERROR', error);
}).on('end', function() {
  console.log('#END');
});

About

A streaming riakpbc wrapper with advanced features.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published