Skip to content

Multi.subscribe().asStream() slows down JVM termination #1797

Answered by jponge
lorenzpahl asked this question in Q&A
Discussion options

You must be logged in to vote

This is because an executor is involved under the hood, and by default this is Executors.newCachedThreadPool() so the JVM will not terminate until all its threads expire.

You can tweak this by calling Infrastructure.setDefaultExecutor(...) and use another one.

Note that you don't have to do that if you are using Mutiny in Quarkus, as we already set an executor that's well integrated with the rest of the framework.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lorenzpahl
Comment options

Answer selected by cescoffier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1796 on January 28, 2025 06:41.