How to use denque - 3 common examples

To help you get started, we’ve selected a few denque 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 fluture-js / Fluture / src / internal / interpreter.js View on Github external
export default function interpretSequence(seq, rec, rej, res){

  //This is the primary queue of actions. All actions in here will be "cold",
  //meaning they haven't had the chance yet to run concurrent computations.
  var queue = new Denque();

  //These combined variables define our current state.
  // future  = the future we are currently forking
  // action  = the action to be informed when the future settles
  // cancel  = the cancel function of the current future
  // settled = a boolean indicating whether a new tick should start
  // async   = a boolean indicating whether we are awaiting a result asynchronously
  var future, action, cancel = noop, stack = nil, settled, async = true, it;

  //Pushes a new action onto the stack. The stack is used to keep "hot"
  //actions. The last one added is the first one to process, because actions
  //are pushed right-to-left (see warmupActions).
  function pushStack(x){
    stack = cons(x, stack);
  }
github fluture-js / Fluture / src / future.js View on Github external
Transformation.prototype._interpret = function Transformation$interpret(rec, rej, res){

  //This is the primary queue of actions. All actions in here will be "cold",
  //meaning they haven't had the chance yet to run concurrent computations.
  var queue = new Denque();

  //These combined variables define our current state.
  // future  = the future we are currently forking
  // action  = the action to be informed when the future settles
  // cancel  = the cancel function of the current future
  // settled = a boolean indicating whether a new tick should start
  // async   = a boolean indicating whether we are awaiting a result asynchronously
  var future, action, cancel = noop, stack = nil, settled, async = true, it;

  //Pushes a new action onto the stack. The stack is used to keep "hot"
  //actions. The last one added is the first one to process, because actions
  //are pushed right-to-left (see warmupActions).
  function pushStack(x){
    stack = cons(x, stack);
  }
github jonnyboyC / kos-language-server / server / src / analysis / resolver.ts View on Github external
constructor(
    script: IScript,
    symbolTableBuilder: SymbolTableBuilder,
    logger: ILogger = mockLogger,
    tracer: ITracer = mockTracer,
  ) {
    this.script = script;
    this.tableBuilder = symbolTableBuilder;
    this.localResolver = new LocalResolver();
    this.setResolver = new SetResolver(this.localResolver);
    this.deferred = new Denque();
    this.lazyGlobal = true;
    this.firstStmt = true;
    this.deferResolve = true;

    this.loopDepth = 0;
    this.functionDepth = 0;
    this.triggerDepth = 0;

    this.logger = logger;
    this.tracer = tracer;
  }

denque

The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.

Apache-2.0
Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Popular denque functions