Package ai.djl.serving.util
Class ServerGroups
- java.lang.Object
-
- ai.djl.serving.util.ServerGroups
-
public class ServerGroups extends java.lang.Object
A class that holds all openedChannelGroup
andEventLoopGroup
.
-
-
Constructor Summary
Constructors Constructor Description ServerGroups(ConfigManager configManager)
Constructs a newServerGroups
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.channel.EventLoopGroup
getChildGroup()
Returns the client event loop group.io.netty.channel.EventLoopGroup
getServerGroup()
Returns the server event loop group.void
registerChannel(io.netty.channel.Channel channel)
Registers a channel to be tracked.void
reset()
Resets theServerGroups
.void
shutdown(boolean graceful)
Shutdowns all opened channels and event loops.
-
-
-
Constructor Detail
-
ServerGroups
public ServerGroups(ConfigManager configManager)
Constructs a newServerGroups
instance.- Parameters:
configManager
- the configuration
-
-
Method Detail
-
reset
public final void reset()
Resets theServerGroups
.
-
shutdown
public void shutdown(boolean graceful)
Shutdowns all opened channels and event loops.- Parameters:
graceful
-ture
for gracefully clean up the resources
-
getServerGroup
public io.netty.channel.EventLoopGroup getServerGroup()
Returns the server event loop group.- Returns:
- the server event loop group
-
getChildGroup
public io.netty.channel.EventLoopGroup getChildGroup()
Returns the client event loop group.- Returns:
- the client event loop group
-
registerChannel
public void registerChannel(io.netty.channel.Channel channel)
Registers a channel to be tracked.- Parameters:
channel
- a channel to be tracked
-
-