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

ru.tinkoff.kora.scheduling.jdk.SchedulingJdkModule Maven / Gradle / Ivy

There is a newer version: 1.1.9
Show newest version
package ru.tinkoff.kora.scheduling.jdk;

import ru.tinkoff.kora.common.DefaultComponent;
import ru.tinkoff.kora.config.common.Config;
import ru.tinkoff.kora.config.common.extractor.ConfigValueExtractor;
import ru.tinkoff.kora.config.common.factory.MapConfigFactory;
import ru.tinkoff.kora.scheduling.common.SchedulingModule;

import java.util.Map;

public interface SchedulingJdkModule extends SchedulingModule {

    default ScheduledExecutorServiceConfig scheduledExecutorServiceConfig(Config config, ConfigValueExtractor extractor) {
        var value = config.get("scheduling");
        return extractor.extract(value);
    }

    @DefaultComponent
    default JdkSchedulingExecutor scheduledExecutorServiceLifecycle(ScheduledExecutorServiceConfig config) {
        return new DefaultJdkSchedulingExecutor(config);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy