Skip to content

Commit 6362141

Browse files
committed
Moved commit "Support cancel after in rate limiter" from ydb repo
1 parent 8067e11 commit 6362141

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/ydb-cpp-sdk/client/rate_limiter/rate_limiter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ class TRateLimiterClient {
159159
TAsyncDescribeResourceResult DescribeResource(const std::string& coordinationNodePath, const std::string& resourcePath, const TDescribeResourceSettings& = {});
160160

161161
// Acquire resources's units inside a coordination node.
162+
// If CancelAfter is set greater than zero and less than OperationTimeout
163+
// and resource is not ready after CancelAfter time,
164+
// the result code of this operation will be CANCELLED and resource will not be spent.
165+
// It is recommended to specify both OperationTimeout and CancelAfter.
166+
// CancelAfter should be less than OperationTimeout.
162167
TAsyncStatus AcquireResource(const std::string& coordinationNodePath, const std::string& resourcePath, const TAcquireResourceSettings& = {});
163168

164169
private:

src/api/protos/ydb_rate_limiter.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ message DescribeResourceResult {
266266
//
267267

268268
message AcquireResourceRequest {
269+
// If cancel_after is set greater than zero and less than operation_timeout
270+
// and resource is not ready after cancel_after time,
271+
// the result code of this operation will be CANCELLED and resource will not be spent.
272+
// It is recommended to specify both operation_timeout and cancel_after.
273+
// cancel_after should be less than operation_timeout and non zero.
269274
Ydb.Operations.OperationParams operation_params = 1;
270275

271276
// Path of a coordination node.

0 commit comments

Comments
 (0)