package com.malk.delegate.impl;

import com.malk.delegate.McDelegate;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class McImplDelegate implements McDelegate {

    @SneakyThrows
    @Async
    @Override
    public void setTimeout(Invoke fn, long millis) {

        Thread.sleep(millis);
        fn.execute();
    }
}
