All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kestra.runner.h2.H2WorkerTriggerResultQueue Maven / Gradle / Ivy

There is a newer version: 0.18.8
Show newest version
package io.kestra.runner.h2;

import io.kestra.core.exceptions.DeserializationException;
import io.kestra.core.queues.WorkerTriggerResultQueueInterface;
import io.kestra.core.runners.WorkerTriggerResult;
import io.kestra.core.utils.Either;
import io.kestra.jdbc.JdbcWorkerTriggerResultQueueService;
import io.micronaut.context.ApplicationContext;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.function.Consumer;

@Slf4j
public class H2WorkerTriggerResultQueue extends H2Queue implements WorkerTriggerResultQueueInterface {
    private final JdbcWorkerTriggerResultQueueService jdbcWorkerTriggerResultQueueService;

    public H2WorkerTriggerResultQueue(ApplicationContext applicationContext) {
        super(WorkerTriggerResult.class, applicationContext);
        this.jdbcWorkerTriggerResultQueueService = applicationContext.getBean(JdbcWorkerTriggerResultQueueService.class);
    }

    @Override
    public Runnable receive(String consumerGroup, Class queueType, Consumer> consumer) {
        return jdbcWorkerTriggerResultQueueService.receive(consumerGroup, queueType, consumer);
    }

    @Override
    public void close() throws IOException {
        super.close();
        jdbcWorkerTriggerResultQueueService.close();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy