in curator-recipes/src/main/java/org/apache/curator/framework/recipes/queue/DistributedQueue.java [153:184]
public void start() throws Exception {
if (!state.compareAndSet(State.LATENT, State.STARTED)) {
throw new IllegalStateException();
}
try {
client.create().creatingParentContainersIfNeeded().forPath(queuePath);
} catch (KeeperException.NodeExistsException ignore) {
// this is OK
}
if (lockPath != null) {
try {
client.create().creatingParentContainersIfNeeded().forPath(lockPath);
} catch (KeeperException.NodeExistsException ignore) {
// this is OK
}
}
if (!isProducerOnly || (maxItems != QueueBuilder.NOT_SET)) {
childrenCache.start();
}
if (!isProducerOnly) {
service.submit(new Callable<Object>() {
@Override
public Object call() {
runLoop();
return null;
}
});
}
}