All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nassimus.thread.Runnable Maven / Gradle / Ivy

There is a newer version: 1.0.9
Show newest version
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