#include <userver/ydb/coordination.hpp>
Coordination Session.
Definition at line 22 of file coordination.hpp.
Public Types | |
| enum class | Mode { kNormal , kForce } |
| Semaphore deletion mode. More... | |
Public Member Functions | |
| std::uint64_t | GetSessionId () |
| Get session id. | |
| NYdb::NCoordination::ESessionState | GetSessionState () |
| Get session state. | |
| NYdb::NCoordination::EConnectionState | GetConnectionState () |
| Get connection state. | |
| void | Close () |
| Close session. | |
| void | Ping () |
| Ping. | |
| void | Reconnect () |
| Reconnect session. | |
| bool | AcquireSemaphore (std::string_view name, const NYdb::NCoordination::TAcquireSemaphoreSettings &settings) |
| bool | ReleaseSemaphore (std::string_view name) |
| Release semaphore. | |
| NYdb::NCoordination::TSemaphoreDescription | DescribeSemaphore (std::string_view name, const NYdb::NCoordination::TDescribeSemaphoreSettings &settings) |
| void | CreateSemaphore (std::string_view name, std::uint64_t limit, std::string_view data={}) |
| void | UpdateSemaphore (std::string_view name, std::string_view data) |
| Update semaphore. | |
| void | DeleteSemaphore (std::string_view name, Mode mode=Mode::kNormal) |
|
strong |
Semaphore deletion mode.
| Enumerator | |
|---|---|
| kNormal | Fail if the semaphore is currently acquired. |
| kForce | Delete even if currently acquired by sessions. |
Definition at line 71 of file coordination.hpp.
| bool ydb::CoordinationSession::AcquireSemaphore | ( | std::string_view | name, |
| const NYdb::NCoordination::TAcquireSemaphoreSettings & | settings ) |
Acquire semaphore
| void ydb::CoordinationSession::CreateSemaphore | ( | std::string_view | name, |
| std::uint64_t | limit, | ||
| std::string_view | data = {} ) |
Create semaphore
| data | user-defined data attached to the semaphore |
| void ydb::CoordinationSession::DeleteSemaphore | ( | std::string_view | name, |
| Mode | mode = Mode::kNormal ) |
Delete semaphore
| mode | deletion mode; use Mode::kForce to delete even if currently acquired |
| NYdb::NCoordination::TSemaphoreDescription ydb::CoordinationSession::DescribeSemaphore | ( | std::string_view | name, |
| const NYdb::NCoordination::TDescribeSemaphoreSettings & | settings ) |
Describe semaphore