C# Class Grpc.Core.GrpcEnvironment

Encapsulates initialization and shutdown of gRPC library.
Show file Open project: endlessm/chromium-browser Class Usage Examples

Private Properties

Property Type Description
AddRef GrpcEnvironment
GetCompletionQueueCountOrDefault int
GetCoreVersionString string
GetRefCount int
GetThreadPoolSizeOrDefault int
GrpcEnvironment System
GrpcNativeInit void
GrpcNativeShutdown void
PickCompletionQueue Grpc.Core.Internal.CompletionQueueSafeHandle
RegisterChannel void
RegisterServer void
ReleaseAsync Task
ShutdownAsync Task
UnregisterChannel void
UnregisterServer void

Public Methods

Method Description
KillServersAsync ( ) : Task

Requests immediate shutdown of all servers created by the current process.

SetCompletionQueueCount ( int completionQueueCount ) : void

Sets the number of completion queues in the gRPC thread pool that polls for internal RPC events. Can be only invoke before the GrpcEnviroment is started and cannot be changed afterwards. Setting the number of completions queues is an advanced setting and you should only use it if you know what you are doing. Most users should rely on the default value provided by gRPC library. Note: this method is part of an experimental API that can change or be removed without any prior notice.

SetLogger ( ILogger customLogger ) : void

Sets the application-wide logger that should be used by gRPC.

SetThreadPoolSize ( int threadCount ) : void

Sets the number of threads in the gRPC thread pool that polls for internal RPC events. Can be only invoke before the GrpcEnviroment is started and cannot be changed afterwards. Setting thread pool size is an advanced setting and you should only use it if you know what you are doing. Most users should rely on the default value provided by gRPC library. Note: this method is part of an experimental API that can change or be removed without any prior notice.

ShutdownChannelsAsync ( ) : Task

Requests shutdown of all channels created by the current process.

Private Methods

Method Description
AddRef ( ) : GrpcEnvironment

Returns a reference-counted instance of initialized gRPC environment. Subsequent invocations return the same instance unless reference count has dropped to zero previously.

GetCompletionQueueCountOrDefault ( ) : int
GetCoreVersionString ( ) : string

Gets version of gRPC C core.

GetRefCount ( ) : int
GetThreadPoolSizeOrDefault ( ) : int
GrpcEnvironment ( ) : System

Creates gRPC environment.

GrpcNativeInit ( ) : void
GrpcNativeShutdown ( ) : void
PickCompletionQueue ( ) : CompletionQueueSafeHandle

Picks a completion queue in a round-robin fashion. Shouldn't be invoked on a per-call basis (used at per-channel basis).

RegisterChannel ( Grpc.Core.Channel channel ) : void
RegisterServer ( Grpc.Core.Server server ) : void
ReleaseAsync ( ) : Task

Decrements the reference count for currently active environment and asynchronously shuts down the gRPC environment if reference count drops to zero.

ShutdownAsync ( ) : Task

Shuts down this environment.

UnregisterChannel ( Grpc.Core.Channel channel ) : void
UnregisterServer ( Grpc.Core.Server server ) : void

Method Details

KillServersAsync() public static method

Requests immediate shutdown of all servers created by the current process.
public static KillServersAsync ( ) : Task
return Task

SetCompletionQueueCount() public static method

Sets the number of completion queues in the gRPC thread pool that polls for internal RPC events. Can be only invoke before the GrpcEnviroment is started and cannot be changed afterwards. Setting the number of completions queues is an advanced setting and you should only use it if you know what you are doing. Most users should rely on the default value provided by gRPC library. Note: this method is part of an experimental API that can change or be removed without any prior notice.
public static SetCompletionQueueCount ( int completionQueueCount ) : void
completionQueueCount int
return void

SetLogger() public static method

Sets the application-wide logger that should be used by gRPC.
public static SetLogger ( ILogger customLogger ) : void
customLogger ILogger
return void

SetThreadPoolSize() public static method

Sets the number of threads in the gRPC thread pool that polls for internal RPC events. Can be only invoke before the GrpcEnviroment is started and cannot be changed afterwards. Setting thread pool size is an advanced setting and you should only use it if you know what you are doing. Most users should rely on the default value provided by gRPC library. Note: this method is part of an experimental API that can change or be removed without any prior notice.
public static SetThreadPoolSize ( int threadCount ) : void
threadCount int
return void

ShutdownChannelsAsync() public static method

Requests shutdown of all channels created by the current process.
public static ShutdownChannelsAsync ( ) : Task
return Task