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

ru.yandex.qatools.camelot.api.LockableStorage Maven / Gradle / Ivy

There is a newer version: 2.5.4
Show newest version
package ru.yandex.qatools.camelot.api;

import java.util.concurrent.TimeUnit;

/**
 * @author Ilya Sadykov (mailto: [email protected])
 */
public interface LockableStorage {

    /**
     * Tries to lock the key within storage. Blocks the execution for the given timeout.
     * If lock is not succeeded within the given timeout, it releases the blocking.
     */
    boolean lock(String key, long timeout, TimeUnit ofUnit);

    /**
     * Unlocks the key within storage. Method is not blocking and returns instantly.
     */
    void unlock(String key);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy