ctb_workspace/
process.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2/*
3This file is part of Collective Toolbox, a database and document workspace and utilities.
4Copyright (C) 2026 Collective Toolbox Developers
5Contact: info@collectivetoolbox.com
6
7This program is free software: you can redistribute it and/or modify it under
8the terms of the GNU Affero General Public License as published by the Free
9Software Foundation, either version 3 of the License, or (at your option) any
10later version.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License along
17with this program.  If not, see <https://www.gnu.org/licenses/>.
18*/
19
20//! Legacy process-management utilities.
21//!
22//! The old IPC stack tracked subprocesses and per-process HTTP channels in this
23//! crate. The new IPC stack owns process lifecycle inside
24//! `ctb_workspace_ipc::process_manager` and `ctb_workspace_ipc::workspace_runner`.
25//!
26//! This module remains as a small compatibility layer for any remaining callers
27//! during migration, but it intentionally avoids re-introducing the legacy IPC
28//! channel abstractions.
29
30#[allow(
31    unused_imports,
32    clippy::wildcard_imports,
33    reason = "Standard workspace prelude"
34)]
35use crate::utilities::*;
36
37/// Best-effort emergency exit for unrecoverable situations.
38///
39/// The IPC runner will attempt to clean up subprocesses via OS-level process
40/// groups / parent-death semantics. This function is a last resort.
41pub fn emergency_exit(exit_code: i32) -> ! {
42    std::process::exit(exit_code)
43}