Skip to content

Instantly share code, notes, and snippets.

@azenla
Created June 13, 2013 03:28
Show Gist options
  • Save azenla/5771044 to your computer and use it in GitHub Desktop.
Save azenla/5771044 to your computer and use it in GitHub Desktop.
WorkerThread is a JPowerThread type https://gist.github.com/kaendfinger/5756602
package jpower.thread
class WorkerThread implements Runnable {
def closure
WorkerThread(Closure closure) {
this.closure = closure
}
def execute() {
def thread = new Thread(this)
thread.start()
return thread
}
def void run() {
closure.run()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment