package cn.feast.coding.test;

import java.util.concurrent.Callable;

public class CallableTask implements Callable<Integer> {
    Integer i;

    public CallableTask(Integer i) {
        super();
        this.i = i;
    }

    @Override
    public Integer call() throws Exception {
        if (i == 1) {
            Thread.sleep(3000);
        } else if (i == 5) {
            Thread.sleep(5000);
        } else {
            Thread.sleep(1000);
        }
        System.out.println("task线程" + Thread.currentThread().getName() + "任务" + i + "完成");
        return i;
    }
}
