Package org.drasyl.node
Class DrasylNodeSharedEventLoopGroupHolder
java.lang.Object
org.drasyl.node.DrasylNodeSharedEventLoopGroupHolder
Holds parent and child
EventLoops that are shared across all
DrasylNodes.
https://github.com/netty/netty/issues/639#issuecomment-9263566
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.channel.EventLoopGroupstatic io.netty.channel.nio.NioEventLoopGroupUse thisNioEventLoopGroupfor theDrasylNode's network basedChannels (udp server, tcp client, etc.).static io.netty.channel.EventLoopGroupstatic io.netty.util.concurrent.Future<Void>shutdown()Shutdown the two schedulers.
-
Field Details
-
PARENT_DEFAULT_THREADS
public static final int PARENT_DEFAULT_THREADS -
CHILD_DEFAULT_THREADS
public static final int CHILD_DEFAULT_THREADS -
NETWORK_DEFAULT_THREADS
public static final int NETWORK_DEFAULT_THREADS
-
-
Method Details
-
getParentGroup
public static io.netty.channel.EventLoopGroup getParentGroup()Use thisEventLoopGroupfor theDrasylNode'sServerChannel. By default the group hasPARENT_DEFAULT_THREADSthreads. This number can be changed by using the java system propertyorg.drasyl.event-loop.parent.- Returns:
- a
EventLoopGroupfor parent channels
-
getChildGroup
public static io.netty.channel.EventLoopGroup getChildGroup()Use thisEventLoopGroupfor theDrasylNode'sServerChannel. By default the group hasCHILD_DEFAULT_THREADSthreads. This number can be changed by using the java system propertyorg.drasyl.event-loop.child.- Returns:
- a
EventLoopGroupfor child channels
-
getNetworkGroup
public static io.netty.channel.nio.NioEventLoopGroup getNetworkGroup()Use thisNioEventLoopGroupfor theDrasylNode's network basedChannels (udp server, tcp client, etc.). By default the group hasNETWORK_DEFAULT_THREADSthreads. This number can be changed by using the java system propertyorg.drasyl.event-loop.network.- Returns:
- a
NioEventLoopGroupfor child channels
-
shutdown
Shutdown the two schedulers.This operation cannot be undone. After performing this operation, no new task can be submitted!
-