Skip to content
chsbe edited this page May 17, 2016 · 2 revisions

Sometimes you have to call blocking APIs from your show (Most of existing APIs in the java world are blocking). In that case you can call the show.blocking(Closure closure) method.

This will execute the function in a separated thread pool avoiding the blocking of the show event loop.

Example in Javascript

show.blocking(function() {
   java.lang.Thread.sleep(10000)
})

Example in Groovy

show.blocking {
   sleep 10000
}

Clone this wiki locally