Class Latch
java.lang.Object
java.util.concurrent.CountDownLatch
org.simpleframework.transport.reactor.Latch
The
Latch
is used to provide a simple latch that will
allow a thread to block until it is signaled that it is ready.
The latch will block on the close
method and when the
latch is signaled the close method will release all threads.-
Constructor Details
-
Latch
public Latch()Constructor for theLatch
object. This will create a count down latch that will block when it is closed. Any blocked threads will be released when the latch is signaled that it is ready.
-
-
Method Details
-
signal
This is used to signal that the latch is ready. Invoking this method will release all threads that are blocking on the close method. This method is used when the distributor is closed and all operations have been purged.- Throws:
IOException
-
close
This will block all threads attempting to close the latch. All threads will be release when the latch is signaled. This is used to ensure the distributor blocks until it has fully purged all registered operations that are registered.- Throws:
IOException
-