-
-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you consider supporting Solon, Java21, and virtual threads #470
Comments
Hi! I am not familiar with Solon, though db-scheduler should be easy to setup in any framework. I have not tried it with virtual threads, but I believe it should work if you send in an |
Before this, I had tried to adapt to console+db scheduler, but I am very unfamiliar with db scheduler and cannot adapt. I have already implemented a custom thread pool for virtual threads in quatrz. |
You can create custom executor services with help of the @Component
@RequiredArgsConstructor
public class DbSchedulerCustomizer implements com.github.kagkarlsson.scheduler.boot.config.DbSchedulerCustomizer {
private final DbSchedulerProperties dbSchedulerProperties;
@Override
public Optional<ExecutorService> executorService() {
final ThreadFactory threadFactory = Thread.ofVirtual()
.name(Scheduler.THREAD_PREFIX + "-execute-task-", 1)
.factory();
return Optional.of(Executors.newScheduledThreadPool(dbSchedulerProperties.getThreads(), threadFactory));
}
@Override
public Optional<ExecutorService> dueExecutor() {
final ThreadFactory threadFactory = Thread.ofVirtual()
.name(Scheduler.THREAD_PREFIX + "-execute-due-", 1)
.factory();
return Optional.of(Executors.newSingleThreadExecutor(threadFactory));
}
@Override
public Optional<ScheduledExecutorService> housekeeperExecutor() {
final ThreadFactory threadFactory = Thread.ofVirtual()
.name(Scheduler.THREAD_PREFIX + "-housekeeper-", 1)
.factory();
return Optional.of(Executors.newScheduledThreadPool(3, threadFactory));
}
} |
Prerequisites
Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
Expected Behavior
Hello @kagkarlsson ,
may I ask if it supports solon and Java21 and virtual threads? This is very important
The text was updated successfully, but these errors were encountered: