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

xyz.block.ftl.LeaseClient Maven / Gradle / Ivy

The newest version!
package xyz.block.ftl;

import java.time.Duration;

/**
 * Client that can be used to acquire a FTL lease. If the lease cannot be acquired a {@link LeaseFailedException} is thrown.
 */
public interface LeaseClient {

    /**
     * Acquire a lease for the given keys. The lease will be held for the given duration.
     *
     * @param duration The time to acquire the lease for
     * @param keys The lease keys
     * @return A handle that can be used to release the lease
     * @throws LeaseFailedException
     */
    LeaseHandle acquireLease(Duration duration, String... keys) throws LeaseFailedException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy