Skip to content

Commit

Permalink
Support Virtual Threads in the WorkManager
Browse files Browse the repository at this point in the history
- Fixes #147
  • Loading branch information
gastaldi committed Jan 30, 2025
1 parent 316a236 commit daa5e7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-context-propagation-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-virtual-threads-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.ironjacamar</groupId>
<artifactId>quarkus-ironjacamar</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-context-propagation</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-virtual-threads</artifactId>
</dependency>
<dependency>
<groupId>jakarta.resource</groupId>
<artifactId>jakarta.resource-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.function.Supplier;

import jakarta.enterprise.inject.spi.DeploymentException;
import jakarta.resource.ResourceException;

import org.eclipse.microprofile.context.ManagedExecutor;
import org.jboss.jca.core.api.bootstrap.CloneableBootstrapContext;
import org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager;
import org.jboss.jca.core.bootstrapcontext.BaseCloneableBootstrapContext;
Expand All @@ -33,6 +33,7 @@
import io.quarkus.narayana.jta.runtime.TransactionManagerConfiguration;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;
import io.quarkus.virtual.threads.VirtualThreadsRecorder;
import io.smallrye.common.annotation.Identifier;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Future;
Expand Down Expand Up @@ -131,7 +132,7 @@ public void initDefaultBootstrapContext(BeanContainer beanContainer) {
TransactionIntegration transactionIntegration = beanContainer.beanInstance(TransactionIntegration.class);
SecurityIntegration securityIntegration = beanContainer.beanInstance(QuarkusSecurityIntegration.class);
BaseCloneableBootstrapContext bootstrapContext = new BaseCloneableBootstrapContext();
ManagedExecutor executorService = beanContainer.beanInstance(ManagedExecutor.class);
ExecutorService executorService = VirtualThreadsRecorder.getCurrent();

// Create WorkManagerImpl
WorkManagerImpl workManager = new WorkManagerImpl();
Expand Down

0 comments on commit daa5e7b

Please sign in to comment.