Skip to content

Files

Latest commit

2e0db0c · Apr 15, 2025

History

History

rpcstream

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 26, 2022
Apr 24, 2024
Apr 29, 2024
Mar 9, 2025
Apr 4, 2023
Aug 22, 2023
Apr 24, 2024
Feb 20, 2024
Apr 15, 2025
Apr 7, 2025
Jul 1, 2022
Apr 7, 2025
Apr 15, 2025

RPC Stream

This package implements running a RPC service on top of another.

The "host" service has a signature like:

syntax = "proto3";
package mypackage;

import "github.com/aperturerobotics/starpc/rpcstream/rpcstream.proto";

// HostService proxies RPC calls to a target Mux.
service HostService {
  // MyRpc opens a stream to proxy a RPC call.
  rpc MyRpc(stream .rpcstream.RpcStreamPacket) returns (stream .rpcstream.RpcStreamPacket);
}

NewRpcStreamOpenStream(componentID, hostService.MyRpc) will construct a new OpenStreamFunc which starts a RPC call to MyRpc and forwards the starpc packets over the two-way stream.

The component ID can be used to determine which Mux the client should access.