Created
January 27, 2011 04:44
-
-
Save devrim/798078 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
class kdApi | |
@tries=0 | |
constructor:-> | |
@apicall(1) | |
returned:(r)-> | |
if r isnt 10 | |
setTimeout () => | |
@apicall r | |
,1000 | |
else | |
@finished r | |
finished:(r)-> | |
console.log "finished with "+r | |
apicall:(i)-> | |
@tries++ | |
console.log "called with "+i+" @tries:"+@tries | |
@returned Math.floor Math.random()*11 | |
new kdApi() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment