Resolve the service mode from the environment. See the module docs: local is the default; unknown values route local (no socket probing — an `ATOMIC_SERVICE=auto` refinement is deliberately out of scope).
()
| 80 | /// local is the default; unknown values route local (no socket probing — |
| 81 | /// an `ATOMIC_SERVICE=auto` refinement is deliberately out of scope). |
| 82 | pub fn mode() -> Mode { |
| 83 | match std::env::var(ENV_SERVICE).ok().as_deref() { |
| 84 | Some("reactor") => return Mode::Reactor, |
| 85 | Some("local") => return Mode::Local, |
| 86 | _ => {} |
| 87 | } |
| 88 | match std::env::var(ENV_RPC).ok().as_deref() { |
| 89 | Some("1") => Mode::Reactor, |
| 90 | _ => Mode::Local, |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | /// One backend's live session state. |
| 95 | enum Backend { |