moonbitstack/moonzero/registry does not have a README file
pub(all) enum Balancer {
RoundRobinBalancer(RoundRobin)
PickFirst
WeightedBalancer(WeightedRoundRobin)
}fn InMemoryRegistry::register(self : InMemoryRegistry, service : String, endpoint : Endpoint) -> Stringpub struct LoadBalancedChannel {
resolve : (String) -> Array[Endpoint]
cluster : RpcCluster
balancer : Balancer
service : String
}fn LoadBalancedChannel::call(self : LoadBalancedChannel, path : String, request : Bytes) -> Result[Bytes, Status] raisefn LoadBalancedChannel::call_bidi_streaming(self : LoadBalancedChannel, path : String, requests : Array[Bytes]) -> Result[Array[Bytes], Status] raisefn LoadBalancedChannel::call_server_streaming(self : LoadBalancedChannel, path : String, request : Bytes) -> Result[Array[Bytes], Status] raisefn LoadBalancedChannel::new(resolve : (String) -> Array[Endpoint], cluster : RpcCluster, service : String, balancer? : Balancer) -> LoadBalancedChannelpub struct PersistentRegistry {
instances : Map[String, Map[String, Endpoint]]
key_rev : Map[String, Int64]
seq : Int
revision : Int64
events : Array[RegistryEvent]
watchers : Array[(RegistryEvent) -> Unit]
}fn PersistentRegistry::deregister(self : PersistentRegistry, service : String, key : String) -> Boolfn PersistentRegistry::events_since(self : PersistentRegistry, revision : Int64) -> Array[RegistryEvent]fn PersistentRegistry::register(self : PersistentRegistry, service : String, endpoint : Endpoint) -> Stringpub struct RoundRobin {
cursor : Int
}Install
Download zipmoonzero — a service framework for MoonBit (← go-zero): config-driven assembly of a moonapi application with middleware, producing a runnable moonasgi AsgiApp. v0.6.2 runs real unary, server/client-streaming, and bidirectional zRPC calls over moonrpc's h2c transport (an in-process RpcChannel drives HPACK HEADERS + length-prefixed DATA + grpc-status trailers through the H2Server engine), graceful shutdown draining in-flight calls, a persisted, watchable etcd v3-shaped registry (watch, events_since catch-up, snapshot/restore) with round-robin/pick-first balancers and a load-balanced client, real file-backed registry I/O over moonbitlang/async's fs with a live filesystem watcher (native discov driver), request metrics (counter + latency histogram), and W3C traceparent propagation.