MCPcopy Create free account
hub / github.com/1jehuang/jcode / process_instance_token

Function process_instance_token

crates/jcode-base/src/background/model.rs:93–97  ·  view source on GitHub ↗

Random per-process-image instance token for `owner_instance`. Generated once per process image (exec-based reloads get a fresh token even though the PID is unchanged), so status files can tell "this process, task still alive" apart from "same PID after exec, task future is gone".

()

Source from the content-addressed store, hash-verified

91/// the PID is unchanged), so status files can tell "this process, task still
92/// alive" apart from "same PID after exec, task future is gone".
93pub fn process_instance_token() -> &'static str {
94 use std::sync::OnceLock;
95 static TOKEN: OnceLock<String> = OnceLock::new();
96 TOKEN.get_or_init(|| uuid::Uuid::new_v4().simple().to_string())
97}
98
99pub(super) fn normalize_delivery(notify: bool, wake: bool) -> (bool, bool) {
100 (notify || wake, wake)

Callers 6

spawn_with_notifyMethod · 0.85
adopt_with_optionsMethod · 0.85
cancel_with_graceMethod · 0.85

Calls

no outgoing calls

Tested by 1