moonbitstack/moonzero/zrpc does not have a README file
type RpcHandler = (Bytes) -> Bytespub struct BidiCall {
channel : RpcChannel
sid : Int
pending : Bytes
status_code : Int
ended : Bool
}pub(all) struct ClientDeps {
clock : Clock
tracer : Tracer
breaker : Breaker
metrics : RpcMetrics
now : () -> Int64
timeout_ms : Int64
slow_ms : Int64
mute : Array[String]
}fn ClientDeps::new(clock? : Clock, tracer? : Tracer, breaker? : Breaker, metrics? : RpcMetrics, now? : () -> Int64, timeout_ms? : Int64, slow_ms? : Int64, mute? : Array[String]) -> ClientDeps raise Refusedpub(all) struct MethodTimeout {
path : String
budget_ms : Int64
}fn RpcChannel::call(self : RpcChannel, path : String, request : Bytes) -> Result[Bytes, Status] raisefn RpcChannel::call_bidi_streaming(self : RpcChannel, path : String, requests : Array[Bytes]) -> Result[Array[Bytes], Status] raisefn RpcChannel::call_client_streaming(self : RpcChannel, path : String, requests : Array[Bytes]) -> Result[Bytes, Status] raisefn RpcChannel::call_server_streaming(self : RpcChannel, path : String, request : Bytes) -> Result[Array[Bytes], Status] raisefn RpcChannel::call_through(self : RpcChannel, path : String, request : Bytes, parent? : TraceContext) -> Result[Bytes, Status]fn RpcChannel::interceptors(self : RpcChannel) -> Array[((Call) -> Result[Bytes, Status] raise) -> ((Call) -> Result[Bytes, Status] raise)]fn RpcChannel::with_interceptors(self : RpcChannel, interceptors : Array[((Call) -> Result[Bytes, Status] raise) -> ((Call) -> Result[Bytes, Status] raise)]) -> RpcChannelfn RpcGroup::register_bidi_streaming(self : RpcGroup, name : String, factory : () -> BidiStreamHandler) -> Unitfn RpcMetrics::observe(self : RpcMetrics, path : String, status : Int, duration_ms : Double) -> Unitpub struct RpcServer {
conf : RpcServerConf
handlers : Map[String, (Bytes) -> Bytes]
server_streaming : Map[String, (Bytes) -> Array[Bytes]]
client_streaming : Map[String, (Array[Bytes]) -> Bytes]
bidi_streaming : Map[String, () -> BidiStreamHandler]
interceptors : Array[((Call) -> Result[Bytes, Status] raise) -> ((Call) -> Result[Bytes, Status] raise)]
}fn RpcServer::dispatch_graceful(self : RpcServer, coord : ShutdownCoordinator, path : String, request : Bytes) -> Result[Bytes, Status]fn RpcServer::register_bidi_streaming(self : RpcServer, desc : Method, factory : () -> BidiStreamHandler) -> Unitpub(all) struct ServerDeps {
clock : Clock
tracer : Tracer
breaker : Breaker
shedder : Shedder
metrics : RpcMetrics
authenticator : &Authenticator?
now : () -> Int64
timeout_ms : Int64
stat : StatConf
}fn ServerDeps::new(clock? : Clock, tracer? : Tracer, breaker? : Breaker, shedder? : Shedder, metrics? : RpcMetrics, authenticator? : &Authenticator, now? : () -> Int64, timeout_ms? : Int64, stat? : StatConf) -> ServerDeps raise Refusedfn client_interceptors(conf : RpcClientMiddlewaresConf, deps : ClientDeps) -> Array[((Call) -> Result[Bytes, Status] raise) -> ((Call) -> Result[Bytes, Status] raise)]fn server_interceptors(conf : RpcServerMiddlewaresConf, deps : ServerDeps) -> Array[((Call) -> Result[Bytes, Status] raise) -> ((Call) -> Result[Bytes, Status] raise)]Install
Download zipA service framework for MoonBit.