Groovy web console

subscribe to the feed Subscribe
to this
site

Groovy Executor Service

Published 2 weeks ago by MO with tags executor
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
def executor = java.util.concurrent.Executors.newFixedThreadPool(5)

executor.submit { sleep(500); println 'future1' }
executor.submit { sleep(100); println 'future2' }

sleep(1000)

println "Done!"