Skip to content

@DTrejo /proposal.js
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
API thoughts for zookeeper mkdir -p
//
// How would you prefer to use a mkdir-p API?
// Note that this is for making directories in ZooKeeper :)
//
//
// Option #1
//
var mkdirp = require('zk-mkdirp');
var connection = new ZooKeeper(/* ... */);
mkdirp(connection, path, callback);
//
// Option #2
// more complicated to program, and possibly bad b/c require is sync, and
// users might want to create the connection to zookeeper after the first tick
// of the event loop.
//
var connection = new ZooKeeper(/* ... */);
var mkdirp = require('zk-mkdirp')(connection);
mkdirp(path, callback);
//
// Option #3
// best of both worlds? just plain awkward if you only use it once?
//
var mkdirp = require('zk-mkdirp');
var connection = new ZooKeeper(/* ... */);
mkdirp.connection = connection;
mkdirp(path, callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.