Skip to content

GrpcServerActor

Defined in: src/io/broker/GrpcServerActor.ts:78

gRPC server actor. Differs from the BrokerActor base shape — a server is bound, not connected; there are no outbound messages the actor itself produces. Handlers run independently and forward inbound calls to user-supplied target actors.

Lifecycle:

  • preStart: load proto, build server, register methods, bind.
  • postStop: graceful tryShutdown, then forceShutdown after a short grace period.

new GrpcServerActor(_ctorSettings): GrpcServerActor

Defined in: src/io/broker/GrpcServerActor.ts:83

Partial<GrpcServerSettings>

GrpcServerActor

Actor.constructor

get isBound(): boolean

Defined in: src/io/broker/GrpcServerActor.ts:116

Bound port (useful when bind: '0.0.0.0:0' was used to let the OS pick).

boolean

onReceive(_): void

Defined in: src/io/broker/GrpcServerActor.ts:113

Main message handler. Receives each envelope dequeued from the mailbox. A thrown error (sync or async) is caught by the supervisor.

unknown

void

Actor.onReceive


postRestart(_reason): void | Promise<void>

Defined in: src/Actor.ts:55

Called on the fresh instance after a restart. Default: call preStart().

Error

void | Promise<void>

Actor.postRestart


postStop(): Promise<void>

Defined in: src/io/broker/GrpcServerActor.ts:91

Called after the actor has been terminated. Children are already stopped.

Promise<void>

Actor.postStop


preRestart(_reason, _message?): void | Promise<void>

Defined in: src/Actor.ts:50

Called before a restart, on the instance about to be thrown away. The default stops children and then calls postStop().

Error

unknown

void | Promise<void>

Actor.preRestart


preStart(): Promise<void>

Defined in: src/io/broker/GrpcServerActor.ts:85

Called after construction and before the first message is processed.

Promise<void>

Actor.preStart


supervisorStrategy(): SupervisorStrategy

Defined in: src/Actor.ts:63

Supervisor strategy for this actor’s children. Defaults to restart, up to 10 times per minute, then stop.

SupervisorStrategy

Actor.supervisorStrategy