9.2.2 Asynchronous Calls - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
9.2.2 Asynchronous Calls
Similarly to synchronous calls, asynchronous calls inside the UIThread are made by invoking theexecInsideUIAsync{}
method. This method is equivalent to calling doLater{}
in Swing.Example:class MyController { def model def action1 = { // will be invoked inside the UI Thread by default (pre 0.9.2) def value = model.value Thread.start { // do some calculations execInsideUIAsync { // back inside the UI Thread model.result = … } } } def action2 = { // will be invoked outside of the UI Thread by default (post 0.9.2) def value = model.value // do some calculations execInsideUIAsync { // back inside the UI Thread model.result = … } } }