public final class SdkEventLoopGroup extends Object
EventLoopGroup and ChannelFactory for NettyNioAsyncHttpClient.
There are three ways to create a new instance.
builder() to provide custom configuration of EventLoopGroup.
This is the preferred configuration method when you just want to customize the EventLoopGroupcreate(EventLoopGroup) to provide a custom EventLoopGroup. ChannelFactory will
be resolved based on the type of EventLoopGroup provided via
SocketChannelResolver.resolveSocketChannelFactory(EventLoopGroup)
create(EventLoopGroup, ChannelFactory) to provide a custom EventLoopGroup and
ChannelFactory
When configuring the EventLoopGroup of NettyNioAsyncHttpClient, if SdkEventLoopGroup.Builder is
passed to NettyNioAsyncHttpClient.Builder.eventLoopGroupBuilder(software.amazon.awssdk.http.nio.netty.SdkEventLoopGroup.Builder),
the EventLoopGroup is managed by the SDK and will be shutdown when the HTTP client is closed. Otherwise,
if an instance of SdkEventLoopGroup is passed to NettyNioAsyncHttpClient.Builder.eventLoopGroup(software.amazon.awssdk.http.nio.netty.SdkEventLoopGroup),
the EventLoopGroup MUST be closed by the caller when it is ready to be disposed. The SDK will not
close the EventLoopGroup when the HTTP client is closed. See EventExecutorGroup.shutdownGracefully() to
properly close the event loop group.
NettyNioAsyncHttpClient.Builder#eventLoopGroupBuilder(Builder),
NettyNioAsyncHttpClient.Builder.eventLoopGroup(SdkEventLoopGroup)| Modifier and Type | Class and Description |
|---|---|
static interface |
SdkEventLoopGroup.Builder
A builder for
SdkEventLoopGroup. |
| Modifier and Type | Method and Description |
|---|---|
static SdkEventLoopGroup.Builder |
builder() |
io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> |
channelFactory() |
static SdkEventLoopGroup |
create(io.netty.channel.EventLoopGroup eventLoopGroup)
Creates a new instance of SdkEventLoopGroup with
EventLoopGroup. |
static SdkEventLoopGroup |
create(io.netty.channel.EventLoopGroup eventLoopGroup,
io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> channelFactory)
Creates a new instance of SdkEventLoopGroup with
EventLoopGroup and ChannelFactory
to be used with NettyNioAsyncHttpClient. |
io.netty.channel.EventLoopGroup |
eventLoopGroup() |
public io.netty.channel.EventLoopGroup eventLoopGroup()
EventLoopGroup to be used with Netty Http client.public io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> channelFactory()
ChannelFactory to be used with Netty Http Client.public static SdkEventLoopGroup create(io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> channelFactory)
EventLoopGroup and ChannelFactory
to be used with NettyNioAsyncHttpClient.eventLoopGroup - the EventLoopGroup to be usedchannelFactory - the channel factor to be usedpublic static SdkEventLoopGroup create(io.netty.channel.EventLoopGroup eventLoopGroup)
EventLoopGroup.
ChannelFactory will be resolved based on the type of EventLoopGroup provided. IllegalArgumentException will
be thrown for any unknown EventLoopGroup type.
eventLoopGroup - the EventLoopGroup to be usedpublic static SdkEventLoopGroup.Builder builder()
Copyright © 2019. All rights reserved.