Expand description
Single-instance arbitration over rightkit-daemon (no extra plugin, no lock file).
The first process hosts the <service-id>-shell service (see service_name for how an app id
becomes <service-id>) on the suite’s current-user-only socket /
named pipe. A later process finds a live record, forwards its argv and working directory with
second-instance, and exits. Because liveness is a probed endpoint plus a live pid, a crashed
primary never blocks the next launch (a stale record is discarded).
Donors: all three apps used tauri-plugin-single-instance; this keeps its contract
(callback with argv + cwd) and adds suite isolation for tests.
Structs§
- Invalid
AppId - An app id that cannot be turned into a valid
rightkit-daemonname. - Second
Instance
Enums§
- Arbitration
- Invalid
AppId Reason - Why an app id cannot name a single-instance service.
Constants§
Functions§
- arbitrate
- Arbitrate single-instance for
app_id. - arbitrate_
with_ legacy - Arbitration that also probes for a live
tauri-plugin-single-instanceholder underlegacy_identifier(the Tauri identifier) first. A live legacy holder receives this launch and the result isArbitration::Secondary; an unreachable one isArbitration::Unavailable. A socket that only a leaked descriptor keeps open is not a live holder, and a macOS holder that stays silent is logged on stderr as unconfirmed (seeClaimOutcome::Forwarded). - service_
name try_service_namewithout the check: the normalised name even when it is empty or too long, whicharbitratewould refuse. Prefertry_service_name.- try_
service_ name - The service name arbitration hosts for
app_id: the normalised id plus-shell, so an id that is already[a-z0-9-]gives exactly<id>-shell(running instances keep being found across upgrades) and"app.mailright"gives"app-mailright-shell".rightkit-daemonallows only 1 to 48 bytes of[a-z0-9-], so an empty id or one longer than 42 bytes is refused.