forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#9612 from cescoffier/features/mutiny-poo…
…l-configuration Configure Mutiny infra to use Quarkus thread pool
- Loading branch information
Showing
4 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
extensions/mutiny/deployment/src/main/java/io/quarkus/mutiny/deployment/MutinyProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,25 @@ | ||
package io.quarkus.mutiny.deployment; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
|
||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.annotations.ExecutionTime; | ||
import io.quarkus.deployment.annotations.Record; | ||
import io.quarkus.deployment.builditem.ExecutorBuildItem; | ||
import io.quarkus.deployment.builditem.FeatureBuildItem; | ||
import io.quarkus.mutiny.runtime.MutinyInfrastructure; | ||
|
||
public class MutinyProcessor { | ||
|
||
@BuildStep | ||
public FeatureBuildItem registerFeature() { | ||
return new FeatureBuildItem(FeatureBuildItem.MUTINY); | ||
} | ||
|
||
@BuildStep | ||
@Record(ExecutionTime.RUNTIME_INIT) | ||
public void initExecutor(ExecutorBuildItem executorBuildItem, MutinyInfrastructure recorder) { | ||
ExecutorService executor = executorBuildItem.getExecutorProxy(); | ||
recorder.configureMutinyInfrastructure(executor); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/MutinyInfrastructure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.mutiny.runtime; | ||
|
||
import java.util.concurrent.ExecutorService; | ||
|
||
import io.quarkus.runtime.annotations.Recorder; | ||
import io.smallrye.mutiny.infrastructure.Infrastructure; | ||
|
||
@Recorder | ||
public class MutinyInfrastructure { | ||
|
||
public void configureMutinyInfrastructure(ExecutorService exec) { | ||
Infrastructure.setDefaultExecutor(exec); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters