GRPC C++  1.30.0
Public Member Functions
grpc_impl::ResourceQuota Class Referencefinal

ResourceQuota represents a bound on memory and thread usage by the gRPC library. More...

#include <resource_quota_impl.h>

Public Member Functions

 ResourceQuota (const grpc::string &name)
 
 ResourceQuota ()
 
 ~ResourceQuota ()
 
ResourceQuotaResize (size_t new_size)
 Resize this ResourceQuota to a new size. More...
 
ResourceQuotaSetMaxThreads (int new_max_threads)
 Set the max number of threads that can be allocated from this ResourceQuota object. More...
 
grpc_resource_quotac_resource_quota () const
 

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.

Constructor & Destructor Documentation

◆ ResourceQuota() [1/2]

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

◆ ResourceQuota() [2/2]

grpc_impl::ResourceQuota::ResourceQuota ( )

◆ ~ResourceQuota()

grpc_impl::ResourceQuota::~ResourceQuota ( )

Member Function Documentation

◆ c_resource_quota()

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

◆ Resize()

ResourceQuota& grpc_impl::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.

◆ SetMaxThreads()

ResourceQuota& grpc_impl::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.


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