You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class SimpleProcess implements Process {
@Override
public void run() {
System.out.println("This is a process example.");
}
@Override
public void close() throws Exception {
System.out.println("Close resources");
}
}
Wrap the process with UniqueProcess
String zks = "localhost";
Process process = new SimpleProcess();
Competitive competitive = new ZookeeperCompetitiveImpl(zks, "group1");
CompetitiveProcess guard = new CompetitiveProcess(process, competitive);
guard.run();
About
A tool to make a process having only one instance in a cluster