Java Code Examples for org.jgroups.util.Util#sleep()
The following examples show how to use
org.jgroups.util.Util#sleep() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompletableFutureTest.java From jgroups-raft with Apache License 2.0 | 5 votes |
public void run() { Util.sleep(sleep); if(t != null) future.completeExceptionally(t); else future.complete(result); }
Example 2
Source File: VoteTest.java From jgroups-raft with Apache License 2.0 | 5 votes |
protected static Address leader(long timeout, long interval, JChannel ... channels) { long target_time=System.currentTimeMillis() + timeout; while(System.currentTimeMillis() <= target_time) { for(JChannel ch : channels) { if(ch.isConnected() && raft(ch).leader() != null) return raft(ch).leader(); } Util.sleep(interval); } return null; }
Example 3
Source File: DynamicMembershipTest.java From jgroups-raft with Apache License 2.0 | 5 votes |
protected static Address leader(long timeout, long interval, JChannel ... channels) { long target_time=System.currentTimeMillis() + timeout; while(System.currentTimeMillis() <= target_time) { for(JChannel ch : channels) { if(ch.isConnected() && raft(ch).leader() != null) return raft(ch).leader(); } Util.sleep(interval); } return null; }