docs(sdk): Wire::shutdown doc said the second call returns Ok; it returns Stopped
All checks were successful
ci / test (pull_request) Successful in 4m22s
All checks were successful
ci / test (pull_request) Successful in 4m22s
The handle-level call takes the node out on the first shutdown, so a second call reports the typed `WireError::Stopped` (covered by `calls_after_shutdown_are_typed_errors_not_panics`). Only the node-level `Node::shutdown()` is Ok-idempotent. The rustdoc claimed otherwise.
This commit is contained in:
parent
c068e292a0
commit
48c06df2cf
1 changed files with 9 additions and 4 deletions
|
|
@ -225,10 +225,15 @@ impl Wire {
|
||||||
/// attempt, stop the onion service, abort the retry worker, checkpoint the
|
/// attempt, stop the onion service, abort the retry worker, checkpoint the
|
||||||
/// sqlite WAL, and drop the Tor client.
|
/// sqlite WAL, and drop the Tor client.
|
||||||
///
|
///
|
||||||
/// Idempotent and safe to call twice, including from two threads: the
|
/// The *node* teardown is idempotent: a second `Node::shutdown()` returns
|
||||||
/// second call is a no-op returning `Ok`. After it, every other method on
|
/// `Ok` without repeating the work. This handle is spent by the first call,
|
||||||
/// this handle — including `send` — returns `WireError.Stopped` instead of
|
/// so a second `Wire::shutdown()` — or two concurrent teardowns — returns
|
||||||
/// touching a dead client or panicking.
|
/// the typed `WireError.Stopped` instead of a silent `Ok`: a double
|
||||||
|
/// teardown is a caller bug worth surfacing, and `Stopped` is already the
|
||||||
|
/// answer every other method gives. It never panics.
|
||||||
|
///
|
||||||
|
/// After it, every other method on this handle — including `send` —
|
||||||
|
/// returns `WireError.Stopped` instead of touching a dead client.
|
||||||
///
|
///
|
||||||
/// Never called at all when the process is killed outright (Doze, the
|
/// Never called at all when the process is killed outright (Doze, the
|
||||||
/// background-process killer, a force-stop): that is the case [`flush`]
|
/// background-process killer, a force-stop): that is the case [`flush`]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue