io.kestra.runner.h2.H2WorkerJobQueue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdbc-h2 Show documentation
Show all versions of jdbc-h2 Show documentation
The modern, scalable orchestrator & scheduler open source platform
package io.kestra.runner.h2;
import io.kestra.core.exceptions.DeserializationException;
import io.kestra.core.queues.WorkerJobQueueInterface;
import io.kestra.core.runners.WorkerJob;
import io.kestra.core.utils.Either;
import io.kestra.jdbc.JdbcWorkerJobQueueService;
import io.micronaut.context.ApplicationContext;
import lombok.extern.slf4j.Slf4j;
import java.util.function.Consumer;
@Slf4j
public class H2WorkerJobQueue implements WorkerJobQueueInterface {
private final JdbcWorkerJobQueueService jdbcWorkerJobQueueService;
public H2WorkerJobQueue(ApplicationContext applicationContext) {
this.jdbcWorkerJobQueueService = applicationContext.getBean(JdbcWorkerJobQueueService.class);
}
@Override
public Runnable receive(String consumerGroup, Class> queueType, Consumer> consumer) {
return jdbcWorkerJobQueueService.receive(consumerGroup, queueType, consumer);
}
@Override
public void close() {
jdbcWorkerJobQueueService.close();
}
}