Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick example of using JDeferred from Apache Groovy
import org.jdeferred.*
import org.jdeferred.impl.*
def deferred = new DeferredObject()
def promise = deferred.promise()
promise.done { result ->
println "done: $result"
}.fail { rejection ->
println "fail: $rejection"
}.always { state, result, rejection ->
println "always"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment