org.nassimus.thread.Runnable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of FlowControl Show documentation
Show all versions of FlowControl Show documentation
Powerful Thread Pool Executor with Flow Control and BatchBuffer execution
package org.nassimus.thread;
/*
* @author : Nassim MOUALEK
* [email protected]
* */
class Runnable implements java.lang.Runnable {
private final FlowControlExecutor executorWithFlowControl;
private final Callable callable;
public Runnable(FlowControlExecutor executorWithFlowControl, Callable callable){
this.executorWithFlowControl = executorWithFlowControl;
this.callable = callable;
}
@Override
public void run() {
try {
callable.call();
} catch (Exception e) {
executorWithFlowControl.pushException(e);
} finally {
executorWithFlowControl.releaseSemaphore();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy