Created
August 29, 2011 19:52
-
-
Save benek/1179226 to your computer and use it in GitHub Desktop.
Testing SingleThreadExecutor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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