cultmesh-rs: connect_with_wake, a wake handle on the subscription client #200

Merged
eureka merged 5 commits from hands/cultlib-subscription-wake into main 2026-11-29 06:58:59 +00:00
Owner

Cut cultlib-gaps:cut_spec:cut-cultmesh-subscription-wake.r1 (ruling thing2:ruling:mesh-wake-poll).

CultMeshRudpSubscriptionClient::connect_with_wake(options, wake) installs a closure the pump calls on its own thread after each event is queued (once per Snapshot, Commit, Faulted, Disconnected) and once more when the pump ends after close or Drop. A consumer blocks on whatever the wake feeds instead of polling try_drain. connect is unchanged and means no wake; the options struct is untouched. A panic in the wake is caught and the event stays queued. The contract is in the module docs.

Tests: eleven additions in tests/rudp_subscription.rs (existing tests unedited; one helper split into reconnecting_with). cargo test --locked cultmesh-rs 170 passed, cultnet-rs 614 passed; the subscription test file ran 20 times green. cargo-mutants over the diff: 3 caught, 1 timeout (Pump::push with ()), 3 unviable, 0 missed.

🤖 Generated with Claude Code

Cut `cultlib-gaps:cut_spec:cut-cultmesh-subscription-wake.r1` (ruling `thing2:ruling:mesh-wake-poll`). `CultMeshRudpSubscriptionClient::connect_with_wake(options, wake)` installs a closure the pump calls on its own thread after each event is queued (once per Snapshot, Commit, Faulted, Disconnected) and once more when the pump ends after `close` or `Drop`. A consumer blocks on whatever the wake feeds instead of polling `try_drain`. `connect` is unchanged and means no wake; the options struct is untouched. A panic in the wake is caught and the event stays queued. The contract is in the module docs. Tests: eleven additions in `tests/rudp_subscription.rs` (existing tests unedited; one helper split into `reconnecting_with`). `cargo test --locked` cultmesh-rs 170 passed, cultnet-rs 614 passed; the subscription test file ran 20 times green. cargo-mutants over the diff: 3 caught, 1 timeout (`Pump::push` with `()`), 3 unviable, 0 missed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cultmesh-rs: connect_with_wake, a wake handle on the subscription client (cultmesh-subscription-wake)
Some checks failed
Rust crates / cargo test, fmt, clippy (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
1c027bbab8
The pump calls the consumer's closure after each event is queued and once
when it ends after close or Drop, so a consumer blocks on what the wake feeds
instead of polling try_drain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steward decision (coordinator, 2026-11-29): when the client's last handle is
dropped by a wake on the pump thread, Drop sends Close and does not join; the
pump ends once the wake returns. The module docs tell a wake to hold the
client weakly and say why.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steward decision (coordinator, 2026-11-29): a payload whose Drop panics no
longer ends the pump. The docs say a panicking wake aborts the process under
panic = abort.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Steward decision (coordinator, 2026-11-29): close and Drop consume the client,
so nothing can try_drain after the last wake. The docs now say the last wake
releases a blocked waiter, which learns the client is gone from a Weak that no
longer upgrades.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cultmesh-rs: wake tests pin what they name (wake-tests-pin-less-than-named)
All checks were successful
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Successful in 22m51s
Rust crates / cargo test, fmt, clippy (pull_request) Successful in 9m12s
74d87b46a0
Steward decision (coordinator, 2026-11-29). The reconnect test counts the
final wake apart from the abandoned reconnect's Disconnected wake; the
not-lost test reads what the wake drained from the client's own queue; a new
test pins the event counted before its wake, through a test-hooks accessor
beside pump_liveness.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eureka merged commit b2a10b833d into main 2026-11-29 06:58:59 +00:00
eureka deleted branch hands/cultlib-subscription-wake 2026-11-29 06:58:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!200
No description provided.