Skip to main content
AsyncLagerBox is the tokio/reqwest client. It mirrors LagerBox method for method, and both run the same wire layer, so the request bodies and the parsing cannot drift between them.

Enabling

blocking is the default feature, so turning defaults off keeps ureq out of the dependency tree if you only want the async client. Enabling both is fine — they coexist.

Using it

Constructors and handle accessors are ordinary functions; only the calls that do I/O are async. Handle types are prefixed: AsyncSupply, AsyncGpio, AsyncDebugNet and so on.

What the async client does not have

The uart and rtt features both imply blocking, so enabling them pulls in the blocking client whether or not you asked for it. Scope is shared: it is a stub on both, with sync methods.
There is no RAII lock guard on the async client. Take and release the lock explicitly, and make sure the release runs on the error path too.

Running both

Nothing stops you using the async client for the parallel parts of a suite and the blocking client for a UART or RTT session:

Concurrency

The box serializes access per physical instrument, so firing many requests at one instrument concurrently does not interleave its I/O — the requests queue on the box. Concurrency buys you real parallelism only across different instruments.

Notes

  • reqwest is pulled in with default-features = false, so there is no TLS stack. Box traffic is plain HTTP on the local network or over Tailscale.
  • tokio is required only with the time feature for the async client itself; the macros and rt-multi-thread features in the snippet above are for writing the tests.
  • Gateway authentication works identically on both clients, including the automatic token refresh.