Skip to content

Commit

Permalink
[doc] Add How To dispose Event Loop Group/Connection Pool (#3095)
Browse files Browse the repository at this point in the history
Fixes #3071
  • Loading branch information
violetagg committed Mar 11, 2024
1 parent 106273c commit 0597ddd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/asciidoc/eventloop.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

By default `Reactor Netty` uses an "`Event Loop Group`", where the number of the worker threads equals the number of
processors available to the runtime on initialization (but with a minimum value of 4). When you need a different configuration,
you can use one of the {javadoc}/reactor/netty/resources/LoopResources.html[`LoopResource`]`#create`
you can use one of the {javadoc}/reactor/netty/resources/LoopResources.html[`LoopResources`]`#create`
methods.

The following listing shows the default configuration for the Event Loop Group:
Expand All @@ -26,3 +26,14 @@ If you need changes to these settings, you can apply the following configuration
include::{examplesdir}/eventloop/Application.java[lines=18..38]
----
====

==== Disposing Event Loop Group

- If you use the default `Event Loop Group` provided by Reactor Netty, invoke
{javadoc}/reactor/netty/http/HttpResources.html[`HttpResources`]`#disposeLoopsAndConnections`/`#disposeLoopsAndConnectionsLater` method.

NOTE: Disposing `HttpResources` means that every server/client that is using it, will not be able to use it anymore!

- If you use custom `LoopResources`, invoke {javadoc}/reactor/netty/resources/LoopResources.html[`LoopResources`]`#dispose`/`#disposeLater` method.

NOTE: Disposing the custom `LoopResources` means that every server/client that is configured to use it, will not be able to use it anymore!
11 changes: 11 additions & 0 deletions docs/asciidoc/http-client-conn-provider.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ include::{examplesdir}/pool/Application.java[lines=18..49]
----
====

=== Disposing Connection Pool

- If you use the default `ConnectionProvider` provided by Reactor Netty, invoke
{javadoc}/reactor/netty/http/HttpResources.html[`HttpResources`]`#disposeLoopsAndConnections`/`#disposeLoopsAndConnectionsLater` method.

NOTE: Disposing `HttpResources` means that every client that is using it, will not be able to use it anymore!

- If you use custom `ConnectionProvider`, invoke {javadoc}/reactor/netty/resources/ConnectionProvider.html[`ConnectionProvider`]`#dispose`/`#disposeLater`/`#disposeWhen` method.

NOTE: Disposing the custom `ConnectionProvider` means that every client that is configured to use it, will not be able to use it anymore!

=== Metrics
The pooled `ConnectionProvider` supports built-in integration with https://micrometer.io/[`Micrometer`].
It exposes all metrics with a prefix of `reactor.netty.connection.provider`.
Expand Down
11 changes: 11 additions & 0 deletions docs/asciidoc/tcp-client-conn-provider.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ include::{examplesdir}/pool/Application.java[lines=18..35]
----
====

=== Disposing Connection Pool

- If you use the default `ConnectionProvider` provided by Reactor Netty, invoke
{javadoc}/reactor/netty/http/HttpResources.html[`HttpResources`]`#disposeLoopsAndConnections`/`#disposeLoopsAndConnectionsLater` method.

NOTE: Disposing `HttpResources` means that every client that is using it, will not be able to use it anymore!

- If you use custom `ConnectionProvider`, invoke {javadoc}/reactor/netty/resources/ConnectionProvider.html[`ConnectionProvider`]`#dispose`/`#disposeLater`/`#disposeWhen` method.

NOTE: Disposing the custom `ConnectionProvider` means that every client that is configured to use it, will not be able to use it anymore!

=== Metrics
The pooled `ConnectionProvider` supports built-in integration with https://micrometer.io/[`Micrometer`].
It exposes all metrics with a prefix of `reactor.netty.connection.provider`.
Expand Down

0 comments on commit 0597ddd

Please sign in to comment.