lib/policies/speculative-execution.js
function ConstantSpeculativeExecutionPolicy(delay, maxSpeculativeExecutions) {
  if (!(delay >= 0)) {
    throw new errors.ArgumentError('delay must be a positive number or zero');
  }
  if (!(maxSpeculativeExecutions > 0)) {
    throw new errors.ArgumentError('maxSpeculativeExecutions must be a positive number');
  }
  this._delay = delay;
  this._maxSpeculativeExecutions = maxSpeculativeExecutions;
}
function ConstantSpeculativeExecutionPolicy(delay, maxSpeculativeExecutions) {
  if (!(delay >= 0)) {
    throw new errors.ArgumentError('delay must be a positive number or zero');
  }
  if (!(maxSpeculativeExecutions > 0)) {
    throw new errors.ArgumentError('maxSpeculativeExecutions must be a positive number');
  }
  this._delay = delay;
  this._maxSpeculativeExecutions = maxSpeculativeExecutions;
}
Creates a new instance of ConstantSpeculativeExecutionPolicy.
@classdesc
A {@link SpeculativeExecutionPolicy} that schedules a given number of speculative executions,
separated by a fixed delay.
@constructor
@param {Number} delay The delay between each speculative execution.
@param {Number} maxSpeculativeExecutions The amount of speculative executions that should be scheduled after the
initial execution. Must be strictly positive.
@extends {SpeculativeExecutionPolicy}