Skip to content

Instantly share code, notes, and snippets.

@benek
Created August 29, 2011 19:52
Show Gist options
  • Save benek/1179226 to your computer and use it in GitHub Desktop.
Save benek/1179226 to your computer and use it in GitHub Desktop.
Testing SingleThreadExecutor
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
ExecutorService executor = Executors.newSingleThreadExecutor()
10.times {
executor.execute(new Runnable(){
public void run(){
println "Inicio"
Thread.sleep(1000)
println "Fin!"
}
})
}
println "Terminado"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment