Wait for a callback
queue.add(function(){
save(data,()=>this.next());
});Exact runtime source
This page imports the published queue.js directly. Run it, pause the release gate, resume, or clear pending work.
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
Use the queue for sequencing, manual batches, or connection-gated work. The API stays the same.
queue.add(function(){
save(data,()=>this.next());
});queue.autoRun=false;
queue.add(one,two,three);
queue.next();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