package io.gmss.fiscad.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableAsync;

@Configuration
@EnableAsync
public class AsyncConfig {

    @Bean(name = "uploadExecutor")
    public java.util.concurrent.Executor uploadExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Upload-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "pieceExecutor")
    public java.util.concurrent.Executor fileExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Piece-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }


    @Bean(name = "traitementTableRelationnelleExecutor")
    public java.util.concurrent.Executor traitementTableRelationnelleExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("traitementTableRelationnelle- ");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }
    @Bean(name = "personneExecutor")
    public java.util.concurrent.Executor personneExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Personne-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "parcelleExecutor")
    public java.util.concurrent.Executor parcelleExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Parcelle-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(20);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "membreGroupeExecutor")
    public java.util.concurrent.Executor membreGroupeExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("MembreGroupe-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "acteurConcerneExecutor")
    public java.util.concurrent.Executor acteurConcerneExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("ActeurConcerne-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "enqueteExecutor")
    public java.util.concurrent.Executor enqueteExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Enquete-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "enqueteBatimentExecutor")
    public java.util.concurrent.Executor enqueteBatimentExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Enquete Batiment-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "batimentExecutor")
    public java.util.concurrent.Executor batimentExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Batiment-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "uniteLogementExecutor")
    public java.util.concurrent.Executor uniteLogementExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Unite de Logement-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "enqueteUniteLogementExecutor")
    public java.util.concurrent.Executor enqueteUniteLogementExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Enquete Unité Logement-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "caracteristiqueParcelleExecutor")
    public java.util.concurrent.Executor caracteristiqueParcelleExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("Caracteristique Parcelle-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "caracteristiqueBatimentExecutor")
    public java.util.concurrent.Executor caracteristiqueBatimentExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("caracteristique Batiment-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }

    @Bean(name = "caracteristiqueUniteLogementExecutor")
    public java.util.concurrent.Executor caracteristiqueUniteLogementExecutor() {
        var exec = new org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor();
        exec.setThreadNamePrefix("caracteristique Unité de logement-");
        exec.setCorePoolSize(2);
        exec.setMaxPoolSize(16);
        exec.setQueueCapacity(100);
        exec.initialize();
        return exec;
    }
}
