aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Sree Kuchibhotla <sreek@google.com>2018-06-11 08:54:30 -0700
committerGravatar Sree Kuchibhotla <sreek@google.com>2018-07-17 10:25:33 -0700
commit67bb4e30302cec45c9e05144a64ee6a38c0f9559 (patch)
tree45b3f0f58b5f949404c85542ab6b66ce7bd086b7 /include
parenta93fdfce84533eeb26461d2d457256df43dd8078 (diff)
Initial scaffolding
Diffstat (limited to 'include')
-rw-r--r--include/grpc/grpc.h4
-rw-r--r--include/grpcpp/resource_quota.h10
2 files changed, 14 insertions, 0 deletions
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index c129a66949..bc3bc5fbbf 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -450,6 +450,10 @@ GRPCAPI void grpc_resource_quota_unref(grpc_resource_quota* resource_quota);
GRPCAPI void grpc_resource_quota_resize(grpc_resource_quota* resource_quota,
size_t new_size);
+/** Update the size of the maximum number of threads allowed */
+GRPCAPI void grpc_resource_quota_set_max_threads(
+ grpc_resource_quota* resource_quota, int new_max_threads);
+
/** Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota
*/
GRPCAPI const grpc_arg_pointer_vtable* grpc_resource_quota_arg_vtable(void);
diff --git a/include/grpcpp/resource_quota.h b/include/grpcpp/resource_quota.h
index 554437a40d..77cdd48dcc 100644
--- a/include/grpcpp/resource_quota.h
+++ b/include/grpcpp/resource_quota.h
@@ -44,6 +44,16 @@ class ResourceQuota final : private GrpcLibraryCodegen {
/// No time bound is given for this to occur however.
ResourceQuota& Resize(size_t new_size);
+ /// Set the max number of threads that can be allocated from this
+ /// ResourceQuota object.
+ ///
+ /// If the new_max_threads value is smaller than the current value, no new
+ /// threads are allocated until the number of active threads fall below
+ /// new_max_threads. There is no time bound on when this may happen i.e none
+ /// of the current threads are forcefully destroyed and all threads run their
+ /// normal course.
+ ResourceQuota& SetMaxThreads(int new_max_threads);
+
grpc_resource_quota* c_resource_quota() const { return impl_; }
private: