import Command from "../../command/Command.js"; import CliKernel from "../CliKernel.js"; import Kernel from "../Kernel.js"; /** * Commande `nodefony cluster` — démarre le serveur en mode cluster sans PM2. * * Remplace l'ancien `nodefony staging`/`preprod` (retiré 2026-05-25 — fusionné dans * le runtime prod « 2 molettes » : topologie = `cluster.workers`, env = `NODE_ENV`) : * - **cgroup-aware** — `--workers N` explicite, sinon quota CPU cgroup (conteneur), * sinon `os.availableParallelism()`. Plus jamais `os.cpus().length` (bug conteneur). * - **respawn backoff** — un worker mort est re-forké avec backoff exponentiel (anti crash-loop). * - **graceful shutdown** — SIGTERM/SIGINT draine les workers (SIGKILL après timeout). * * Topologie = source unique {@link resolveTopology} : `--workers` > `NF_WORKERS` * > config app `cluster.workers` > défaut 1. **`workers:1` = VRAI mono-process** (zéro * machinerie cluster, un seul Kernel) ; `>= 2` → master (superviseur + gateway IPC) + * N workers (chacun un seul Kernel). * * Régime de déploiement : ON pour container multi-cœurs / VPS / bare-metal ; OFF * (1 process/pod) pour petit pod k8s + HPA. Cf `project_cluster_backplane_vision`. */ declare class Cluster extends Command { constructor(cli: CliKernel); onKernelStart(opts?: { workers?: string; }): Promise; generate(): Promise; } export default Cluster;