![JAR search and dependency download from the Maven repository](/logo.png)
jadex.micro.taskdistributor.ITaskDistributor Maven / Gradle / Ivy
package jadex.micro.taskdistributor;
import jadex.future.IFuture;
import jadex.providedservice.annotation.Service;
@Service
public interface ITaskDistributor
{
public record Task(String id, T task){};
/**
* Publish a new task.
* @param task The task to publish.
*/
public IFuture publish(T task);
/**
* Request a task.
* @return The next task (waits for a task).
*/
public IFuture> requestNextTask();
/**
* Set the result of a task.
* @param id The task id.
* @param result The result.
*/
public IFuture setTaskResult(String id, R result);
/**
* Set the exception of a task.
* @param id The task id.
* @param ex The exception.
*/
public IFuture setTaskException(String id, Exception ex);
/**
* Request a published task
* @param taskid The taskid.
* @return The task (does not wait for the task).
* /
public IFuture requestTask(String taskid);*/
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy