The package is a thin layer over UCall’s native library, and every rule below follows from that.
- Verbs share one name across languages.
TakeCall,TakeCalls,TakeBatch,TakeBatches,SubmitandTakeCompletedname the same calls astake_calland its siblings in C++, Python and Rust. - Blocking stays simple, deferring stays symmetric. A reply that is final on return answers an
error, and one that may finish later answers(*Deferred[T], error), as Rust’sDeferring::answerhands back its refusal before submitting anything. - Ownership is a type, not a flag. A reply takes its
Request, which the library clears once taken, only aDetachedRequesthands back aDeferred, and aResponseis freed byCloseor the collector. - Callbacks cross as handles. Routes, batch endpoints, log sinks and authorizers reach C as
cgo.Handles the server or client deletes when closed, never as Go pointers; a route’s handle holds its handler alone, as each callback receives its server from the library. - One pinned frame per call. Each call pins one allocation holding its outcome, its argument structure and its result, polls included, and a refusal the binding catches allocates only its
Error, before anything is pinned. - No life of its own. The package starts no goroutines, keeps no locks or counters, and recovers no panics, so it drops into any concurrency model.
| Path | Go | Rust |
|---|---|---|
| Blocking call | 1 frame | 0 |
| Refusal before the call | 1 Error | 1 error |
| Deferred submit and wait | 4: frame, Deferred, 2 in AddCleanup | 0 |
| Each callback | 1 Request | 0 |
A completion TakeCompleted lifts adds its Response and that response’s cleanup, and header lines or reply parts add the one array they cross as. TestCallsAllocateOnlyTheirFrames holds the first three rows.