tech.ydb.coordination.impl.LeaseImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ydb-sdk-coordination Show documentation
Show all versions of ydb-sdk-coordination Show documentation
Coordination node client implementation
The newest version!
package tech.ydb.coordination.impl;
import java.util.concurrent.CompletableFuture;
import tech.ydb.coordination.CoordinationSession;
import tech.ydb.coordination.SemaphoreLease;
/**
*
* @author Aleksandr Gorshenin
*/
class LeaseImpl implements SemaphoreLease {
private final SessionImpl session;
private final String name;
LeaseImpl(SessionImpl session, String name) {
this.session = session;
this.name = name;
}
@Override
public CoordinationSession getSession() {
return session;
}
@Override
public String getSemaphoreName() {
return name;
}
@Override
public CompletableFuture release() {
return session.releaseSemaphore(name).thenApply(r -> null);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy