Public Member Functions | Private Member Functions | Private Attributes | List of all members
grpc::ResourceQuota Class Referencefinal

#include <resource_quota.h>

Inheritance diagram for grpc::ResourceQuota:
Inheritance graph
[legend]

Public Member Functions

grpc_resource_quotac_resource_quota () const
 
ResourceQuotaResize (size_t new_size)
 
 ResourceQuota ()
 
 ResourceQuota (const std::string &name)
 
ResourceQuotaSetMaxThreads (int new_max_threads)
 
 ~ResourceQuota () override
 

Private Member Functions

ResourceQuotaoperator= (const ResourceQuota &rhs)
 
 ResourceQuota (const ResourceQuota &rhs)
 
- Private Member Functions inherited from grpc::GrpcLibraryCodegen
 GrpcLibraryCodegen (bool call_grpc_init=true)
 
virtual ~GrpcLibraryCodegen ()
 

Private Attributes

grpc_resource_quota *const impl_
 

Detailed Description

ResourceQuota represents a bound on memory and thread usage by the gRPC library. A ResourceQuota can be attached to a server (via ServerBuilder), or a client channel (via ChannelArguments). gRPC will attempt to keep memory and threads used by all attached entities below the ResourceQuota bound.

Definition at line 34 of file include/grpcpp/resource_quota.h.

Constructor & Destructor Documentation

◆ ResourceQuota() [1/3]

grpc::ResourceQuota::ResourceQuota ( const std::string &  name)
explicit
Parameters
name- a unique name for this ResourceQuota.

Definition at line 31 of file resource_quota_cc.cc.

◆ ResourceQuota() [2/3]

grpc::ResourceQuota::ResourceQuota ( )

Definition at line 29 of file resource_quota_cc.cc.

◆ ~ResourceQuota()

grpc::ResourceQuota::~ResourceQuota ( )
override

Definition at line 34 of file resource_quota_cc.cc.

◆ ResourceQuota() [3/3]

grpc::ResourceQuota::ResourceQuota ( const ResourceQuota rhs)
private

Member Function Documentation

◆ c_resource_quota()

grpc_resource_quota* grpc::ResourceQuota::c_resource_quota ( ) const
inline

Definition at line 57 of file include/grpcpp/resource_quota.h.

◆ operator=()

ResourceQuota& grpc::ResourceQuota::operator= ( const ResourceQuota rhs)
private

◆ Resize()

ResourceQuota & grpc::ResourceQuota::Resize ( size_t  new_size)

Resize this ResourceQuota to a new size. If new_size is smaller than the current size of the pool, memory usage will be monotonically decreased until it falls under new_size. No time bound is given for this to occur however.

Definition at line 36 of file resource_quota_cc.cc.

◆ SetMaxThreads()

ResourceQuota & grpc::ResourceQuota::SetMaxThreads ( int  new_max_threads)

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.

Definition at line 41 of file resource_quota_cc.cc.

Member Data Documentation

◆ impl_

grpc_resource_quota* const grpc::ResourceQuota::impl_
private

Definition at line 63 of file include/grpcpp/resource_quota.h.


The documentation for this class was generated from the following files:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:31