Expand description
RPC method registration: plugins expose methods that PHP workers can invoke
on the master in-process (via the folk_call() native function).
Two shapes of method exist:
- Unary (
RpcRegistrar) — one requestBytes→ one responseBytes, driven by the synchronousfolk_callbridge. - Streaming (
StreamRegistrar, phase 88b) — one open → a stream of messages in either or both directions, driven by the handle-based blocking bridge (folk_stream_open/recv/send/close). The handler returns aStreamConnthe bridge blocking-drains one message at a time.
Structs§
- RpcMethod
Def - Static description of an RPC method (advertised at server start; used for introspection / documentation).
- Stream
Conn - A live stream connection returned by a
StreamHandler. The transport plugin (e.g.folk-plugin-grpc) adapts its own stream type (tonicStreaming) into this transport-agnostic pair; the bridge infolk-extdrives it.
Traits§
- RpcRegistrar
- Allows plugins to register RPC method handlers at boot.
- Stream
Registrar - Allows plugins to register streaming method handlers at boot. Additive
counterpart to
RpcRegistrar;folk-coreprovides the concrete impl.
Type Aliases§
- BoxFuture
- Boxed future returned by an RPC handler.
- Inbound
Stream - Boxed inbound message stream. The bridge blocking-drains it one item at a time
(
folk_stream_recv→Some(bytes)per item,Noneat end-of-stream). - Outbound
Sender - Outbound message channel for client-streaming / bidi: the bridge pushes
PHP-sent messages here (
folk_stream_send), closing it half-closes the send side (folk_stream_close_send).tokio::sync::mpscgives natural backpressure. - RpcHandler
- Type alias for an RPC handler: takes raw request bytes, returns raw response bytes.
- Stream
Handler - A streaming handler: given the initial request bytes, opens a
StreamConn. - Stream
Item - One inbound message of a stream: raw response
Bytes, or an error carrying a gRPC-style status the bridge surfaces to PHP as an exception.