Mojo

UCall for Mojo

ucall_mojo = { git = "https://github.com/unum-cloud/UCall", subdirectory = "mojo", tag = "v1.0.0-rc.1" } 1.0.0-rc.1 · 60202332

It needs Mojo 1.2 through pixi, on Linux x86-64, Linux AArch64 or macOS on Apple silicon, and glibc 2.39 or newer on Linux. It exposes servers with their routes, batch endpoints and replies, and clients with their calls and responses.

Topics

InstallationLet Pixi build the package from source, with no channel to add and no linker flag to pass; the library arrives as its run dependency, in the environment prefix mojo build bakes as runpath.
QuickstartLibrary() opens the shared object once, and every server, client and response created through it keeps it mapped.
Serving41A handler is a compile-time parameter of its route, server.get"/users/{name}", handler and likewise post, put, delete and patch, or routepath, handler and routewithpath, handler for any other.
Requests50
Files and Streams6request^.detach() hands the request to a DetachedRequest, which reads the same way, moves to any thread, and answers 500 when dropped unreplied.
Batches7Requests from every event loop share one queue per endpoint, drained by whichever thread polls it; requests the handler does not take answer 500 once it returns.
Calling31submit admits a call without driving the network, takecompleted drives every admitted call and hands back what finished, and call, with get, post, put, delete and patch, submits one and polls until its own response arrives.
Noise Keys5
Errors5
Threads and Polling2The binding starts no threads and keeps no queues; the application polls every event loop, batch endpoint and client on threads it owns.
Design14