Skip to content
graemerocher edited this page Mar 5, 2013 · 3 revisions

GORM Async API

Callbacks

Book.list() { results ->

}

Promises

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 ->

}

DetachedCriteria

def query1 = Book.where {
  title == "foo"
}
def query2 = Book.where {
  title == "foo"
}

whenDone(query1, query2, query3) { results ->

}
Clone this wiki locally