Last active
August 29, 2015 14:11
-
-
Save acnalesso/6baa485787a981bbe285 to your computer and use it in GitHub Desktop.
deferred_queue_actions#flush example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = new Backburner(['sync', 'actions', 'destroy'], { ... }); | |
b.run(function() { | |
b.schedule('actions', function() { console.log('actions'); }); | |
b.schedule('sync', function() { | |
console.log('flushing sync'); | |
b.schedule('actions', function() { console.log('actions schedduled in sync queue.'); }); | |
}); | |
}); | |
// OUTPUTS | |
flushing sync | |
actions | |
actions schedduled in sync queue. | |
// WHILE LOOP ORDER | |
Queue {name: "sync", globalOptions: Object, options: undefined, _queue: Array[4], targetQueues: Object…} | |
Queue {name: "sync", globalOptions: Object, options: undefined, _queue: Array[0], targetQueues: Object…} | |
Queue {name: "actions", globalOptions: Object, options: undefined, _queue: Array[8], targetQueues: Object…} | |
Queue {name: "sync", globalOptions: Object, options: undefined, _queue: Array[0], targetQueues: Object…} | |
Queue {name: "actions", globalOptions: Object, options: undefined, _queue: Array[0], targetQueues: Object…} | |
Queue {name: "destroy", globalOptions: Object, options: undefined, _queue: Array[0], targetQueues: Object…} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment