package com.ningdatech.pmapi.meeting.task;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * <p>
 * ExpertInviteExecutorConfig
 * </p>
 *
 * @author WendyYang
 * @since 16:21 2022/8/16
 */
@Configuration
public class ExpertInviteExecutorConfig {

    @Bean(name = "expertInviteScheduler")
    public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(3);
        scheduler.setThreadGroupName("expert-invite");
        scheduler.setThreadNamePrefix("invite-executor-");
        scheduler.setAwaitTerminationSeconds(60);
        scheduler.setWaitForTasksToCompleteOnShutdown(true);
        return scheduler;
    }

}
