How to use the comb.collections function in comb

To help you get started, we’ve selected a few comb 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 C2FO / patio / lib / ConnectionPool.js View on Github external
var comb = require("comb"),
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    isFunction = comb.isFunction,
    Queue = comb.collections.Queue,
    merge = comb.merge,
    define = comb.define,
    Pool = comb.collections.Pool;

define(Pool, {

    instance: {
        /**@lends patio.ConnectionPool.prototype*/

        /**
         * ConnectionPool object used internall by the {@link patio.Database} class;
         * @constructs;
         * @param options
         */
        constructor: function (options) {
            options = options || {};
            if (!options.createConnection || !isFunction(options.createConnection)) {
                throw new Error("patio.adapters.clients.ConnectionPool : create connection CB required.");
            }
github C2FO / patio / lib / database / query.js View on Github external
define = comb.define,
    merge = comb.merge,
    hitch = comb.hitch,
    when = comb.when,
    isBoolean = comb.isBoolean,
    isEmpty = comb.isEmpty,
    isArray = comb.isArray,
    isUndefined = comb.isUndefined,
    isPromiseLike = comb.isPromiseLike,
    isUndefinedOrNull = comb.isUndefinedOrNull,
    argsToArray = comb.argsToArray,
    isFunction = comb.isFunction,
    format = comb.string.format,
    Promise = comb.Promise,
    isNull = comb.isNull,
    Queue = comb.collections.Queue,
    sql = require("../sql").sql,
    PromiseList = comb.PromiseList,
    errors = require("../errors"),
    NotImplemented = errors.NotImplemented,
    stream = require("stream"),
    PassThroughStream = stream.PassThrough,
    utils = require("../utils"),
    pipeAll = utils.pipeAll,
    resolveOrPromisfyFunction = utils.resolveOrPromisfyFunction;


var Database = define(null, {
    instance: {
        /**@lends patio.Database.prototype*/

        /**
github C2FO / patio / lib / model.js View on Github external
isBoolean = comb.isBoolean,
    isString = comb.isString,
    argsToArray = comb.argsToArray,
    isInstanceOf = comb.isInstanceOf,
    isHash = comb.isHash,
    when = comb.when,
    merge = comb.merge,
    toArray = comb.array.toArray,
    ModelError = require("./errors").ModelError,
    plugins = require("./plugins"),
    isUndefinedOrNull = comb.isUndefinedOrNull,
    AssociationPlugin = plugins.AssociationPlugin,
    QueryPlugin = plugins.QueryPlugin,
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    HashTable = comb.collections.HashTable,
    hitch = comb.hitch,
    Middleware = comb.plugins.Middleware,
    EventEmitter = require("events").EventEmitter,
    util = require("util"),
    define = comb.define,
    patio;


var MODELS = new HashTable();

var applyColumnTransformMethod = function (val, meth) {
    return !isUndefinedOrNull(meth) ? isFunction(val[meth]) ? val[meth] : isFunction(comb[meth]) ? comb[meth](val) : val : val;
};

var Model = define([QueryPlugin, Middleware], {
    instance: {
github C2FO / werker / lib / pool / pool.js View on Github external
"use strict";
var comb = require("comb"),
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    isFunction = comb.isFunction,
    Queue = comb.collections.Queue,
    merge = comb.merge,
    define = comb.define,
    Pool = comb.collections.Pool,
    LOGGER = comb.logger("werker.pool");


define(Pool, {

    instance: {

        ttlTimeout: 1000,

        /**
         * WorkerPool to create a pool of workers.
         * @constructs
         * @param options
github C2FO / patio / lib / ConnectionPool.js View on Github external
var comb = require("comb"),
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    isFunction = comb.isFunction,
    Queue = comb.collections.Queue,
    merge = comb.merge,
    define = comb.define,
    Pool = comb.collections.Pool;

define(Pool, {

    instance: {
        /**@lends patio.ConnectionPool.prototype*/

        /**
         * ConnectionPool object used internall by the {@link patio.Database} class;
         * @constructs;
         * @param options
         */
        constructor: function (options) {
            options = options || {};
github C2FO / werker / lib / pool / pool.js View on Github external
"use strict";
var comb = require("comb"),
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    isFunction = comb.isFunction,
    Queue = comb.collections.Queue,
    merge = comb.merge,
    define = comb.define,
    Pool = comb.collections.Pool,
    LOGGER = comb.logger("werker.pool");


define(Pool, {

    instance: {

        ttlTimeout: 1000,

        /**
         * WorkerPool to create a pool of workers.
         * @constructs
         * @param options
         */
        constructor: function (options) {
            options = options || {};