Go

UCall for Go

go get github.com/unum-cloud/ucall/golang@main 1.0.0-rc.1 · b7577426

Ask your coding agent about this page, or add the docs server to it

curl -s 'https://www.unum.cloud/docs/ucall/go.md' | claude -p "How would this fit my code?"

Topics

Installation1Fetch the module, which serves and calls HTTP, in plaintext or over Noise, from Go.
QuickstartA server answers on one or more interfaces, and a client calls it; neither starts a goroutine.
Serving40NewServer takes the interfaces to answer on and optional ServerOptions: the Backend, a CPUClass ceiling that caps the picked class rather than demanding one the machine lacks, a Log sink and a StatsD endpoint in Metrics.
Requests39A handler receives each *Request.
Files and Streams6Handlers run on the polling goroutine, so a reply or a pull that finishes later runs on a worker: Request.Detach hands the request over as a *DetachedRequest, which reads and replies like a Request and alone has the verbs below.
Batches5A pooled batch endpoint gathers matching requests from every event loop into one queue and hands them to its handler in batches, which suits work that is cheaper per request in bulk, like GPU inference.
Calling22A Client submits calls without driving the network, and polls to drive them and collect what finished.
Noise Keys8Interfaces and calls can run over the Noise protocol instead of plain TCP, authenticating both sides by 32-byte Curve25519 static keys.
Errors7Every fallible call answers an error, an *ucall.Error carrying the Status the library reported and its static message, which errors.Is matches against a bare Status.
Threads and Polling4The package starts no goroutines: every callback runs on a goroutine the application gave to a polling call, which stays on one thread for that call.
DesignThe package is a thin layer over UCall's native library, and every rule below follows from that.