-
In Wildfly I can inject the Executor services managed by Wildfly as follows:
How can I access/inject the Quarkus managed |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
You can inject a managed executor:
The above is a basic version. You can modify it too in terms of queue, max async tasks and what contexta should it propagate. As for scheduled tasks, I'd suggest looking at quarkus-scheduler which might be what you ultimately want to achieve? |
Beta Was this translation helpful? Give feedback.
@nimo23 Yes, you can
@Inject ExecutorService
and@Inject ScheduledExecutorService
and it's expected that in both cases you get the same instance (or rather a client proxy delegating to the same instance), i.e. the default executor for blocking tasks.And indeed, the
@Inject @VirtualThreads ExecutorService
injects an executor to run tasks on virtual threads.The
@Inject ManagedExecutor
mentioned by Matej is a speci…