Expand description
Standalone single instance with a typed message, usable without the shell plugin.
SingleInstance::claim makes this process the app’s primary, or forwards this launch’s
InstanceMessage (argv, cwd, an optional action and a JSON argument map) to the live primary
and reports that it did. The outcome is typed and fail-closed:
ClaimOutcome::Primary: this process is the primary. Keep the guard for the process lifetime.ClaimOutcome::Forwarded: a live primary accepted the message. The caller must exit.ClaimOutcome::Failed: arbitration could not be decided. The caller must not continue as a second primary; it should report the reason and exit.
Arbitration runs over rightkit-daemon (current-user socket or named pipe, a probed endpoint and
a live pid), so a crashed primary never blocks the next launch. The shell plugin’s own
arbitration (instance, method second-instance) is separate; an app uses one or the other.
Reference: Pulse hub’s win_bridge::claim_instance (a named mutex that forwards --section).
That path fails open when the singleton cannot be secured; this one fails closed.
Structs§
- Claim
Options - Options for
SingleInstance::claim_with_options. - Instance
Message - The payload one launch hands to the primary.
- Legacy
Single Instance Names - Every name
tauri-plugin-single-instance2.x derives from the Tauri identifier (tauri.conf.jsonidentifier). Read from plugin versions 2.4.2 and 2.4.3 (src/platform_impl/{windows,macos,linux}.rs), with the plugin’ssemverfeature off. HeardRight confirmed the names at its locked 2.4.5 (verified by the consumer; 2.4.5 source was not read here). The derivation is pure, so it is the same on every host. - Single
Instance - Standalone single-instance arbitration.
- Single
Instance Guard - Holds one primary claim. Dropping it releases the claim, the same as [
destroy] does for all.
Enums§
- Claim
Failure - Why arbitration could not be decided. Each variant carries the underlying message.
- Claim
Outcome - The typed result of
SingleInstance::claim.
Constants§
- MESSAGE_
METHOD - Service method a forwarded launch calls on the primary.