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 TypeMethodDescriptionvoidclose()Closes allConnectioninstances assocaited with thisAsyncConnectionGroup.AsyncConnection<org.zeromq.ZContext, org.zeromq.ZMQ.Socket> get(int index) Gets theAsyncConnectionat the provided index.voidsignal(Consumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>> consumer) Similar toAsyncConnection.signal(Consumer), this executes the the suppliedConsumerwithin the thread that is servicing all of the underlyingAsyncConnectioninstances associated with theAsyncConnectionGroupintsize()Returns the number ofAsyncConnectioninstances 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:AsyncConnectionGroupReturns the number ofAsyncConnectioninstances in thisAsyncConnectionGroup.- Specified by:
sizein interfaceAsyncConnectionGroup<org.zeromq.ZContext,org.zeromq.ZMQ.Socket> - Returns:
- the size
-
get
Description copied from interface:AsyncConnectionGroupGets theAsyncConnectionat the provided index. TheAsyncConnections will be returned in the order in whichAsyncConnectionGroup.Builder.connection(Function, Consumer)was invoked.- Specified by:
getin 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:AsyncConnectionGroupCloses allConnectioninstances assocaited with thisAsyncConnectionGroup. Safe to call from any thread.- Specified by:
closein interfaceAsyncConnectionGroup<org.zeromq.ZContext,org.zeromq.ZMQ.Socket> - Specified by:
closein interfaceAutoCloseable
-
toString
-
signal
public void signal(Consumer<AsyncConnectionGroup<org.zeromq.ZContext, org.zeromq.ZMQ.Socket>> consumer) Description copied from interface:AsyncConnectionGroupSimilar toAsyncConnection.signal(Consumer), this executes the the suppliedConsumerwithin the thread that is servicing all of the underlyingAsyncConnectioninstances associated with theAsyncConnectionGroup- Specified by:
signalin interfaceAsyncConnectionGroup<org.zeromq.ZContext,org.zeromq.ZMQ.Socket> - Parameters:
consumer-
-