public static interface EventLoopGroupConfiguration.Builder extends CopyableBuilder<EventLoopGroupConfiguration.Builder,EventLoopGroupConfiguration>
EventLoopGroupConfiguration
.Modifier and Type | Method and Description |
---|---|
SdkBuilder<?,EventLoopGroupConfiguration> |
eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Sets the
EventLoopGroup to use for the Netty HTTP client. |
SdkBuilder<?,EventLoopGroupConfiguration> |
eventLoopGroupFactory(EventLoopGroupFactory eventLoopGroupFactory)
Sets the
EventLoopGroupFactory which will be used to create the EventLoopGroup for the Netty
HTTP client. |
copy
apply, build
SdkBuilder<?,EventLoopGroupConfiguration> eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
EventLoopGroup
to use for the Netty HTTP client. This event loop group may be shared
across multiple HTTP clients for better resource and thread utilization. The preferred way to create
an EventLoopGroup
is by using the EventLoopGroupFactory.create()
method which will choose the
optimal implementation per the platform.
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.
This configuration method is only recommended when you wish to share an EventLoopGroup
with multiple clients. If you do not need to share the group it is recommended to use
eventLoopGroupFactory(EventLoopGroupFactory)
as the SDK will handle its cleanup when
the HTTP client is closed.
eventLoopGroup
- Netty EventLoopGroup
to use.DefaultEventLoopGroupFactory
SdkBuilder<?,EventLoopGroupConfiguration> eventLoopGroupFactory(EventLoopGroupFactory eventLoopGroupFactory)
EventLoopGroupFactory
which will be used to create the EventLoopGroup
for the Netty
HTTP client. This allows for custom configuration of the Netty EventLoopGroup
.
The EventLoopGroup
created by the factory is managed by the SDK and will be shutdown
when the HTTP client is closed.
This is the preferred configuration method when you just want to customize the EventLoopGroup
but not share it across multiple HTTP clients. If you do wish to share an EventLoopGroup
, see
eventLoopGroup(EventLoopGroup)
eventLoopGroupFactory
- EventLoopGroupFactory
to use.DefaultEventLoopGroupFactory
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.