Skip to content
Snippets Groups Projects

Fix the worker run test

3 files
+ 26
1
Compare changes
  • Side-by-side
  • Inline

Files

@@ -193,6 +193,17 @@ public class Threads {
@@ -193,6 +193,17 @@ public class Threads {
return this.scheduledExecutor.scheduleWithFixedDelay(this.wrap(task), delay, delay, unit);
return this.scheduledExecutor.scheduleWithFixedDelay(this.wrap(task), delay, delay, unit);
}
}
 
/**
 
* Submits a task as a separate, unmanaged and unpooled thread.
 
*
 
* @param runnable the task to execute
 
*
 
* @return the thread executing the task
 
*/
 
public Thread asThread(final UnsafeRunnable runnable) {
 
return new Thread(this.wrap(runnable));
 
}
 
/**
/**
* Wraps an unsafe runnable into a runnable that will catch the exceptions it could throw.
* Wraps an unsafe runnable into a runnable that will catch the exceptions it could throw.
*
*
Loading