Class AfterConnectionEstablished
java.lang.Object
org.apache.curator.framework.recipes.AfterConnectionEstablished
Utility class to allow execution of logic once a ZooKeeper connection becomes available.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Future
<?> execute
(CuratorFramework client, Runnable runAfterConnection) Spawns a new new background thread that will block until a connection is available and then execute the 'runAfterConnection' logic
-
Method Details
-
execute
public static Future<?> execute(CuratorFramework client, Runnable runAfterConnection) throws Exception Spawns a new new background thread that will block until a connection is available and then execute the 'runAfterConnection' logic- Parameters:
client
- The curator clientrunAfterConnection
- The logic to run- Returns:
- future of the task so it can be canceled, etc. if needed
- Throws:
Exception
-