Last active
December 17, 2015 21:09
-
-
Save randallb/5672932 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
sc = new RC.shortcut; | |
sc.queue(function(chain){ | |
chain.take() | |
chain.load() | |
chain.dothing() | |
}) | |
// chain just adds that to a queue, and when the fn returns, you execute the queue in order. | |
sc.take() // should execute immediately and return a promise. | |
/* | |
potential bug w/ your api: | |
request 1-> queue something, load x, hit a database, get result, insert result into tricaster, send() | |
request 2-> load y, send() | |
actual result -> queue something, load x, load y, send() | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment