Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
succession
One process per role, bound to one run of its owner — and an orderly handover when that run ends.
An advisory lock is the usual way to keep a single helper process unique: whoever takes it is the one. That works until the process that spawned the helper goes away — an update, a crash, a restart. The helper keeps running and keeps the lock, so nothing can start the helper that belongs to the new run. It does not look broken; it looks exactly like a healthy tenant.
This crate is the missing half of that lock: an identity beside it, so an onlooker can tell which run a tenant belongs to, and a helper can tell when the run it serves is over.
Usage
The owner mints one identity per run and passes it down when it spawns a helper:
use ;
const PROTOCOL: Compat = from_raw;
let me = mine;
// Answer `me` over IPC, and pass `me.run.get()` to the helper at spawn.
The helper takes the role, says who it is, and re-checks its owner on every handshake:
use ;
# use ;
# const PROTOCOL: Compat = from_raw;
# let spawned_by = from_raw;
#
let role = new;
let tenancy = role.claim?; // Occupied => someone else is the overlay
tenancy.publish?;
if let Superseded = to.observe
# Ok::
The owner's supervisor asks whether the seat is free before filling it:
use Duration;
use ;
let role = new;
match verdict
# Ok::
Features
The default build decides and nothing else: no dependencies, and it never spawns, signals, exits, or resolves a path. Each feature adds one piece of glue, so a process that only needs the decision pays for nothing else.
| Feature | Adds | Dependency |
|---|---|---|
serde |
Serialization for the identity types, for carrying Identity on your own wire |
serde |
sysinfo |
Tenant::look_up, so live process facts need not be supplied by hand |
sysinfo |
eviction |
eviction::evict, which verifies a pid against the record before signalling it, escalates on a deadline, and waits for the role to be released |
sysinfo |
supervision |
supervision::Supervisor, a probe/spawn/wait/back-off loop over the verdict, reporting events rather than logging them |
none |
Whole-process-tree containment and async supervision stay out of scope;
processkit does those well.
License
MIT OR Apache-2.0.