Description. This method is needed to establish connections with the data nodes. It waits until the requested connection with one or more data nodes is successful, or until a timeout condition is met.
int wait_until_ready ( int timeoutBefore, int timeoutAfter )
Parameters. This method takes two parameters:
timeoutBeforedetermines the number of seconds to wait until the first “live” node is detected. If this amount of time is exceeded with no live nodes detected, then the method immediately returns a negative value.
timeoutAfterdetermines the number of seconds to wait after the first “live” node is detected for all nodes to become active. If this amount of time is exceeded without all nodes becoming active, then the method immediately returns a value greater than zero.
wait_until_ready() returns an
int, whose value is interpreted as follows:
= 0: All nodes are “live”.
> 0: At least one node is “live” (however, it is not known whether all nodes are “live”).
< 0: An error occurred.