Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/swarm-queue-client/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas e23a70e488 refactor(swarm-queue-client): share the connected-client precondition
An unconnected client does not fail a JetStream request, it hangs on it:
`retry_on_initial_connect` hands back a client before it is usable, and a
request made in that window waits (measured: still going at 15s against a
queue that refuses the credential). The controller guarded its read path
against that inline. Every consumer of the queue needs the same guard, so
it is not one daemon's to keep.

It matters more off a request path than on one. A hung request inside a
periodic task never reaches its `select!`, so the shutdown branch becomes
unreachable and the task cannot be stopped at all — where a request path
merely times a poll out.

The test is `!= Connected`, never `== Disconnected`: a client that has
never connected sits in `Pending`, so the `Disconnected` form passes it
straight through to the hang it was written to prevent — which is exactly
the boot-order case the guard exists for. Not feature-gated;
`connection_state()` is core async-nats.
2026-08-16 13:12:59 +02:00
..
lib.rs refactor(swarm-queue-client): share the connected-client precondition 2026-08-16 13:12:59 +02:00
status.rs refactor(swarm-queue-client): share the hive-status bucket's name and shape 2026-08-16 13:12:59 +02:00