All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dengchen2020.lock.api.DLock Maven / Gradle / Ivy

There is a newer version: 0.0.28
Show newest version
package io.github.dengchen2020.lock.api;

import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

/**
 * 锁的简单接口
 * @author dengchen
 * @since 2024/7/3
 */
public interface DLock {

    void tryLockAndRun(String key, Runnable runnable) throws InterruptedException;

    void tryLockAndRun(String key, long waitTime, TimeUnit unit, Runnable runnable) throws InterruptedException;

     T tryLockAndRun(String key, Callable callable) throws Exception;

     T tryLockAndRun(String key, long waitTime, TimeUnit unit, Callable callable) throws Exception;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy