示例#1
0
function Thread(worker) {
  Responder.call(this);
  this.worker = worker;
  this.roles = {};

  this._initEvents();
}
示例#2
0
/**
 * 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 = [];
}
示例#3
0
文件: abstract.js 项目: 4gh/gaia
/**
 * 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'
  ]);
}
示例#4
0
文件: time.js 项目: 4gh/gaia
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');
}
示例#5
0
文件: caldav.js 项目: 4gh/gaia
function Service(service) {
  Responder.call(this);

  this.service = service;
  this._initEvents();
}
示例#6
0
文件: error.js 项目: MaxMillion/gaia
/**
 * 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);
}
示例#7
0
/**
 * 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' ]);
}
示例#8
0
文件: mock_stream.js 项目: 4gh/gaia
function MockStream() {
  Responder.call(this);

  this._queue = [];
  this._workingQueue = false;
}