Adding ScalaDoc to ThreadPoolBuilder.scala
This commit is contained in:
parent
2dffb2b659
commit
f8aca9eee5
1 changed files with 5 additions and 0 deletions
|
|
@ -212,6 +212,11 @@ trait ExecutorServiceDelegate extends ExecutorService {
|
||||||
def invokeAny[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) = executor.invokeAny(callables, l, timeUnit)
|
def invokeAny[T](callables: Collection[_ <: Callable[T]], l: Long, timeUnit: TimeUnit) = executor.invokeAny(callables, l, timeUnit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The RejectedExecutionHandler used by Akka, it improves on CallerRunsPolicy
|
||||||
|
* by throwing a RejectedExecutionException if the executor isShutdown.
|
||||||
|
* (CallerRunsPolicy silently discards the runnable in this case, which is arguably broken)
|
||||||
|
*/
|
||||||
class SaneRejectedExecutionHandler extends RejectedExecutionHandler {
|
class SaneRejectedExecutionHandler extends RejectedExecutionHandler {
|
||||||
def rejectedExecution(runnable: Runnable, threadPoolExecutor: ThreadPoolExecutor): Unit = {
|
def rejectedExecution(runnable: Runnable, threadPoolExecutor: ThreadPoolExecutor): Unit = {
|
||||||
if (threadPoolExecutor.isShutdown) throw new RejectedExecutionException("Shutdown")
|
if (threadPoolExecutor.isShutdown) throw new RejectedExecutionException("Shutdown")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue