package com.se.auth.service; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * 异步服务 * * @author WWW * @date 2024-08-25 */ @Slf4j @Service @SuppressWarnings("ALL") public class AsyncService { public void asyncCall() { try { ExecutorService executor = Executors.newSingleThreadExecutor(); executor.execute(new Runnable() { @Override @SneakyThrows public void run() { // } }); executor.shutdown(); } catch (Exception ex) { log.error(ex.getMessage(), ex); } } }