C# Класс Grpc.Core.GrpcEnvironment

Encapsulates initialization and shutdown of gRPC library.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

KillServersAsync() публичный статический Метод

Requests immediate shutdown of all servers created by the current process.
public static KillServersAsync ( ) : Task
Результат Task

SetCompletionQueueCount() публичный статический Метод

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
Результат void

SetLogger() публичный статический Метод

Sets the application-wide logger that should be used by gRPC.
public static SetLogger ( ILogger customLogger ) : void
customLogger ILogger
Результат void

SetThreadPoolSize() публичный статический Метод

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
Результат void

ShutdownChannelsAsync() публичный статический Метод

Requests shutdown of all channels created by the current process.
public static ShutdownChannelsAsync ( ) : Task
Результат Task