Sha256: 8ec217297946094040faa55b931d017b9299e009e90815a86c895fc60f975145

Contents?: true

Size: 1.68 KB

Versions: 14

Compression:

Stored size: 1.68 KB

Contents

  /** Provides a virtual time scheduler that uses Date for absolute time and number for relative time. */
  Rx.HistoricalScheduler = (function (__super__) {
    inherits(HistoricalScheduler, __super__);

    /**
     * Creates a new historical scheduler with the specified initial clock value.
     * @constructor
     * @param {Number} initialClock Initial value for the clock.
     * @param {Function} comparer Comparer to determine causality of events based on absolute time.
     */
    function HistoricalScheduler(initialClock, comparer) {
      var clock = initialClock == null ? 0 : initialClock;
      var cmp = comparer || defaultSubComparer;
      __super__.call(this, clock, cmp);
    }

    var HistoricalSchedulerProto = HistoricalScheduler.prototype;

    /**
     * Adds a relative time value to an absolute time value.
     * @param {Number} absolute Absolute virtual time value.
     * @param {Number} relative Relative virtual time value to add.
     * @return {Number} Resulting absolute virtual time sum value.
     */
    HistoricalSchedulerProto.add = function (absolute, relative) {
      return absolute + relative;
    };

    HistoricalSchedulerProto.toDateTimeOffset = function (absolute) {
      return new Date(absolute).getTime();
    };

    /**
     * Converts the TimeSpan value to a relative virtual time value.
     * @memberOf HistoricalScheduler
     * @param {Number} timeSpan TimeSpan value to convert.
     * @return {Number} Corresponding relative virtual time value.
     */
    HistoricalSchedulerProto.toRelative = function (timeSpan) {
      return timeSpan;
    };

    return HistoricalScheduler;
  }(Rx.VirtualTimeScheduler));

Version data entries

14 entries across 7 versions & 1 rubygems

Version Path
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/inquirer/node_modules/rx/src/core/concurrency/historicalscheduler.js