1. Docs
  2. Examples

Exact runtime source

Watch explicit flow stay ordered.

This page imports the published queue.js directly. Run it, pause the release gate, resume, or clear pending work.

Ready · 4 tasks
1 · prepare
2 · connect
3 · send
4 · record
What you are seeing

Each task owns the amber active state for a short delay, then calls this.next(). Pause closes the stop gate; clear removes only tasks that have not started.

Copy a shape

Three focused recipes.

Use the queue for sequencing, manual batches, or connection-gated work. The API stays the same.

Sequential

Wait for a callback

queue.add(function(){
    save(data,()=>this.next());
});
Batch

Start manually

queue.autoRun=false;
queue.add(one,two,three);
queue.next();
Gate

Wait for readiness

queue.stop=true;
queue.add(send);
ready.then(()=>{
    queue.stop=false;
    queue.next();
});

Want to change queue state and see the matching code?

Open Playground