Class JeroMQAsyncConnectionGroup
java.lang.Object
dev.getelements.elements.rt.jeromq.JeroMQAsyncConnectionGroup
- All Implemented Interfaces:
AsyncConnectionGroup<org.zeromq.ZContext,
,org.zeromq.ZMQ.Socket> AutoCloseable
public class JeroMQAsyncConnectionGroup
extends Object
implements AsyncConnectionGroup<org.zeromq.ZContext,org.zeromq.ZMQ.Socket>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.getelements.elements.rt.AsyncConnectionGroup
AsyncConnectionGroup.Builder<ContextT,
BuilderSocketT> -
Constructor Summary
ConstructorsConstructorDescriptionJeroMQAsyncConnectionGroup
(List<AsyncConnection<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>> connectionList, BiConsumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>, Consumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>>> signalHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes allConnection
instances assocaited with thisAsyncConnectionGroup
.AsyncConnection
<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> get
(int index) Gets theAsyncConnection
at the provided index.void
signal
(Consumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>> consumer) Similar toAsyncConnection.signal(Consumer)
, this executes the the suppliedConsumer
within the thread that is servicing all of the underlyingAsyncConnection
instances associated with theAsyncConnectionGroup
int
size()
Returns the number ofAsyncConnection
instances in thisAsyncConnectionGroup
.toString()
-
Constructor Details
-
JeroMQAsyncConnectionGroup
public JeroMQAsyncConnectionGroup(List<AsyncConnection<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>> connectionList, BiConsumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>, Consumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>>> signalHandler)
-
-
Method Details
-
size
public int size()Description copied from interface:AsyncConnectionGroup
Returns the number ofAsyncConnection
instances in thisAsyncConnectionGroup
.- Specified by:
size
in interfaceAsyncConnectionGroup<org.zeromq.ZContext,
org.zeromq.ZMQ.Socket> - Returns:
- the size
-
get
Description copied from interface:AsyncConnectionGroup
Gets theAsyncConnection
at the provided index. TheAsyncConnection
s will be returned in the order in whichAsyncConnectionGroup.Builder.connection(Function, Consumer)
was invoked.- Specified by:
get
in interfaceAsyncConnectionGroup<org.zeromq.ZContext,
org.zeromq.ZMQ.Socket> - Parameters:
index
- the index of theAsyncConnection
- Returns:
- the
AsyncConnection
-
close
public void close()Description copied from interface:AsyncConnectionGroup
Closes allConnection
instances assocaited with thisAsyncConnectionGroup
. Safe to call from any thread.- Specified by:
close
in interfaceAsyncConnectionGroup<org.zeromq.ZContext,
org.zeromq.ZMQ.Socket> - Specified by:
close
in interfaceAutoCloseable
-
toString
-
signal
public void signal(Consumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>> consumer) Description copied from interface:AsyncConnectionGroup
Similar toAsyncConnection.signal(Consumer)
, this executes the the suppliedConsumer
within the thread that is servicing all of the underlyingAsyncConnection
instances associated with theAsyncConnectionGroup
- Specified by:
signal
in interfaceAsyncConnectionGroup<org.zeromq.ZContext,
org.zeromq.ZMQ.Socket> - Parameters:
consumer
-
-