Skip to main content

runtime_id

Function runtime_id 

Source
pub fn runtime_id(checkout_id: &str) -> String
Expand description

The runtime slot of a checkout: 16 hex of a digest of its checkout id. A runtime is one server of one node, so this is what makes a restarted server the same runtime as the one it replaced — a new instance of it rather than a new participant — while two worktrees of one machine stay two runtimes that can claim against each other.

use majordomus_cli::mesh::repository::runtime_id;

assert_eq!(runtime_id("checkout-1"), runtime_id("checkout-1"), "a restart is not a new runtime");
assert_ne!(runtime_id("checkout-1"), runtime_id("checkout-2"));
assert_eq!(runtime_id("checkout-1").len(), 16);