com.linkedin.parseq.zk.recipes.Synchronizable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of parseq-zk-client Show documentation
Show all versions of parseq-zk-client Show documentation
Integrates ParSeq with Apache ZooKeeper Library
package com.linkedin.parseq.zk.recipes;
import com.linkedin.parseq.Task;
/**
* Synchronizable represents a object upon which {@link Task}s within different plans
* can be properly synchronized.
*
* @author Ang Xu
*/
public interface Synchronizable {
/**
* Runs the given task while holding this synchronizable.
*
* @param task task to run
* @param deadline the absolute time, in milliseconds, to wait for the synchronizable.
*
* @return a new task wrapped with {@link ZKLock#synchronize(Task, long)}
*/
Task synchronize(Task task, long deadline);
}