We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Book.list() { results -> }
def promise1 = Book.async.list() def promise2 = Book.async.list() def promise3 = Book.async.list() whenDone(promise1, promise2, promise3) { results -> } whenDone(promise1, promise2, promise3).then { results -> }, { error -> }
def query1 = Book.where { title == "foo" } def query2 = Book.where { title == "foo" } whenDone(query1, query2, query3) { results -> }
def doStuff() { return { // return a closure // long running task } } def list() { // return closures as model values, executed asynchronously [books: { Book.list() }, count: { Book.count() } ] } // gpars integration def hardwork() { final polish = ... final transform = ... final save = ... final notify = ... Promise promiseForStuff = task { loadStuffFromDB() } promiseForStuff.then polish then transform then save [stuff: promiseForStuff] // return model values as promises }