10 / ROUTING
rpcconf
The server and client blocks: the timeout, both CPU thresholds, authentication, and one flag per interceptor, all loading from a config document with their defaults.
WHERE IT SITS
INTERFACE
struct RpcServerMiddlewaresConfstruct
fn RpcServerMiddlewaresConf::new( trace~ : Bool = true, recover~ : Bool = true, stat~ : Bool = true, prometheus~ : Bool = true, breaker~ : Bool = true, shedding~ : Bool = true, timeout~ : Bool = true, auth~ : Bool = true) -> RpcServerMiddlewaresConffnThe full server chain, which is what the reference implementation defaults to.
extend RpcServerMiddlewaresConf with @json.FromJson::item
extend RpcServerMiddlewaresConf with Debug::item
extend RpcServerMiddlewaresConf with Eq::item
struct RpcClientMiddlewaresConfstruct
fn RpcClientMiddlewaresConf::new( trace~ : Bool = true, log~ : Bool = true, prometheus~ : Bool = true, breaker~ : Bool = true, timeout~ : Bool = true) -> RpcClientMiddlewaresConffnThe full client chain.
extend RpcClientMiddlewaresConf with @json.FromJson::item
extend RpcClientMiddlewaresConf with Debug::item
extend RpcClientMiddlewaresConf with Eq::item
struct RpcServerConfstruct
fn RpcServerConf::new( name~ : String = "rpc", host~ : String = "0.0.0.0", port~ : Int32 = rpc_port, timeout_ms~ : Int32 = 2000, cpu_threshold~ : Int64 = 900L, cpu_threshold_overload~ : Int64 = 950L, auth~ : Bool = false, health~ : Bool = true, middlewares~ : RpcServerMiddlewaresConf = RpcServerMiddlewaresConf::new()) -> RpcServerConffnBuild an RPC server config with the reference implementation's defaults: the family's rpc port, a 2s timeout, 90% CPU as the shed threshold and 95% as the overload threshold.
extend RpcServerConf with Debug::item
extend RpcServerConf with Eq::item
fn RpcServerConf::from_json(src : String) -> RpcServerConf raise RefusedfnLoad an RpcServerConf from a JSON config string, filling omitted fields from the new() defaults — the lenient loader matching the reference implementation's ,optional/,default= config tags.
fn RpcServerConf::from_yaml(src : String) -> RpcServerConf raise RefusedfnLoad an RpcServerConf from a YAML config string, with the same default-filling semantics as from_json.
struct RpcClientConfstruct
fn RpcClientConf::new( target~ : String = "", endpoints~ : Array[String] = [], timeout_ms~ : Int32 = 2000, non_block~ : Bool = false, middlewares~ : RpcClientMiddlewaresConf = RpcClientMiddlewaresConf::new()) -> RpcClientConffnA client config with a 2s call timeout and the full interceptor chain.
extend RpcClientConf with Debug::item
extend RpcClientConf with Eq::item
fn RpcClientConf::from_json(src : String) -> RpcClientConf raise RefusedfnLoad an RpcClientConf from a JSON config string, filling omitted fields from the new() defaults.
fn RpcClientConf::from_yaml(src : String) -> RpcClientConf raise RefusedfnLoad an RpcClientConf from a YAML config string.