How to use the couchbase.Couchbase function in couchbase

To help you get started, we’ve selected a few couchbase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github couchbase / couchnode / tests / couchbase_new.js View on Github external
cb.remaining = 0;

    for (var i = 0; i < ops.length; i++) {

        var fnparams = ops[i];
        var fn = fnparams.shift();
        fnparams.push([cb, fn.name]);
        fn.apply(cb, fnparams);
    }

    cb.remaining = i-1;
}

for (var i = 0; i < max_handles; i++) {
    var cb = new driver.Couchbase(
            "localhost:8091");

    cb.id = i + 0;
    var cberr = (function(iter) {
        return function() {
            console.log("Error handler for " + iter);
            errorHandler.apply(this, arguments);
        }
    })(cb.id);
    cb.on("error", cberr);

    // Try to connect to the server
    var clofn = function (cbv) {
        return function() {
            on_connect(cbv);
        }
github couchbase / couchnode / tests / couchbase_dparams.js View on Github external
cbdata['data'] = [cb, fn.name];
        cbdata['exp'] = Math.round(Math.random() * 1000);
        fnparams.push(cbdata);

        try {
            fn.apply(cb, fnparams);
        } catch(err) {
            console.log("Error while executing %s: (%s)", fn.name, err);
        }
    }

    cb.remaining = i-1;
}

for (var i = 0; i < max_handles; i++) {
    var cb = new driver.Couchbase(
            "localhost:8091"
        );

    cb._opCallStyle('dict');

    cb.id = i + 0;
    var cberr = (function(iter) {
        return function() {
            console.log("Error handler for " + iter);
            errorHandler.apply(this, arguments);
        }
    })(cb.id);
    cb.on("error", cberr);
    console.log("Created new handle " + cb.id);
    handles[i] = cb;
    schedule_operations(cb);
github couchbase / couchnode / tests / couchbase.js View on Github external
console.log("Error while executing %s: (%s)", fn.name, err);
        }
    }

    cb.remaining = i-1;
}

var schedfuncs = {
    "dict" : schedule_operations_dict,
    "positional" : schedule_operations_positional
};


for (var i = 0; i < max_handles; i++) {
    
    var cb = new driver.Couchbase(
        params.params["hostname"],
        params.params["username"],
        params.params["password"],
        params.params["bucket"]
    );
    
    cb.id = i + 0;
    var cberr = (function(iter) {
        return function() {
            console.log("Error handler for " + iter);
            errorHandler.apply(this, arguments);
        }
    })(cb.id);
    
    cb.on("error", cberr);
    schedfuncs[params.params['callstyle']](cb);
github couchbase / couchnode / tests / params.js View on Github external
exports.create_handle = function() {
    var driver = require('couchbase');
    exports.parse_cliargs();
    
    var cb = new driver.Couchbase(
        exports.params['hostname'],
        exports.params['username'],
        exports.params['password'],
        exports.params['bucket']
    );
    return cb;
};