function Thread(worker) { Responder.call(this); this.worker = worker; this.roles = {}; this._initEvents(); }
/** * Worker manager. Each worker/thread * is assigned one or more roles. * * There may be one or more workers for * each role and there is a contract * that assumes all roles are stateless * requests/streams are routed to workers * and will be completed eventually * but without order guarantees. */ function Manager() { this._lastId = 0; Responder.call(this); this.roles = Object.create(null); this.workers = []; }
/** * Creates an abstract store instance. * Every store must contain a reference * to the database. */ function Abstract(db, app) { this.db = db; this.app = app; this._cached = Object.create(null); Responder.call(this); denodeifyAll(this, [ 'persist', 'all', '_allCached', 'removeByIndex', 'get', 'remove', 'count' ]); }
function Time(app) { this.app = app; Responder.call(this); TimeObserver.call(this); this._timeCache = Object.create(null); /** cache of all loaded events */ this._eventsCache = Object.create(null); this._timespans = []; this._collection = new IntervalTree(); this._collection.createIndex('eventId'); this.busytime = app.store('Busytime'); this.calendarStore = app.store('Calendar'); }
function Service(service) { Responder.call(this); this.service = service; this._initEvents(); }
/** * Global error handler / default handling for errors. * * @param {Calendar.App} app current application. */ function ErrorController(app) { Responder.call(this); this.app = app; this._handlers = Object.create(null); }
/** * Helper class to create accounts. * Emits events during the process of * creation to allow views to hook into * the full cycle while further separating * this logic from their own. * * * Events: * * - authorize * - calendar sync * * * @param {Calendar.App} app instance of app. */ function AccountCreation() { this.app = app; Responder.call(this); denodeifyAll(this, [ 'send' ]); }
function MockStream() { Responder.call(this); this._queue = []; this._workingQueue = false; }