grpcproc
Documentation

Erlang-style processes for Go over gRPC.

A Go library that gives goroutines typed mailboxes, addresses that work across nodes, monitors and supervision trees.

go get github.com/floatdrop/grpcproc

One API, local or remote

a call within a node, and the same call across nodes
node shopnode warehousecashier.Call[*Charged](ctx, p, req)stock.Call[*Reserved](ctx, p, req)gRPCdeskcashierstockChargeChargedReserveReserved
node shopnode warehousecashier.Call[*Charged](ctx, p, req)stock.Call[*Reserved](ctx, p, req)gRPCdeskcashierstockChargeChargedReserveReserved

A process is a goroutine with a mailbox and an address. Send and Call take the address and are written the same way wherever the process runs: within a program the message is passed as a pointer, and between nodes it travels a gRPC stream, in order. The address carries the message type, so the compiler checks every send.

Processes and messages · Addresses

Failure as a message

a crash, and the restart
supervisorstockdeskcashierexited: booma new process, under the same nameDown{boom}start
supervisorstockdeskcashierexited: booma new process, under the same nameDown{boom}start

A process that returns an error or panics exits with a reason. Every process that monitors it receives a Down carrying that reason, after the last message the process sent. A supervisor is a process that monitors its children and restarts them by a strategy: only the one that exited, all of them, or it and those started after it.

Monitors and links · Supervision

A lost node

a node that cannot be reached
node shopp.Monitor(stock)desknode warehousestocklink lostDown{noconnection}
node shopp.Monitor(stock)desknode warehousestocklink lostDown{noconnection}

When a node cannot be reached, monitors of its processes fire with reason noconnection, and calls waiting on it fail with ErrNoConnection. A node that restarts is a new incarnation: an address from before the restart reaches no process, never a different one.

Nodes and links · Errors and exit reasons

Inspection

grpcprocctl web: a process whose mailbox grows
The Processes view of the Web UI sorted by mailbox, with one process open beside it: its mailbox depth charted, its message rates, and what it publishes about itself.The Processes view of the Web UI sorted by mailbox, with one process open beside it: its mailbox depth charted, its message rates, and what it publishes about itself.

Every process keeps counters, its mailbox depth and its state, and can publish what it holds. The Inspector serves that for the whole cluster from one endpoint, to a command line, a Web UI and AI agents over MCP. Metrics and traces go to OpenTelemetry.

Requirements

  • Go 1.27 or later.
  • A *grpc.Server of yours. grpcproc registers one service on it and opens no listener; credentials, discovery and logging stay the application's.
  • Messages are protobuf messages.
  • The core depends on gRPC, protobuf and fsm, which has no dependencies. etcd and OpenTelemetry support are separate modules.

Documentation

Performance compares grpcproc with GoAkt, Hollywood, Proto.Actor and Ergo.