60 std::function<void(std::function<
void()> wake)>
set_waker;
64 std::function<std::unique_ptr<IEngineRunner>(
RunnerDeps& deps)>
make;
66 std::function<void(IEngineRunner& runner)>
finished;
71 std::function<std::string(
const std::vector<std::pair<std::string, std::string>>&,
InstrumentId)>
102 std::string
program =
"fastmm-live";
106 std::function<std::string()>
watchdog;
118inline constexpr int kExitOk = 0;
Definition config.hpp:302
Definition params.hpp:102
Typed configuration (8.7).
Definition session.hpp:50
constexpr int kExitKilled
engine-tripped kill switch with [engine] on_kill = "exit"
Definition session.hpp:125
constexpr int kExitSlowTier
LiveOptions::watchdog (a Python slow tier failed)
Definition session.hpp:126
constexpr int kExitVenue
venue reference data failed
Definition session.hpp:123
constexpr int kExitUsage
bad command line, missing API keys
Definition session.hpp:121
constexpr int kExitRuntime
cancel_all failed, journal, ring overflow, uncaught error
Definition session.hpp:124
constexpr std::int64_t kKilledReminderNs
How often a session that stays up after a kill ([engine] on_kill = "stay") repeats its ERROR.
Definition session.hpp:131
bool resolve_venue_env(Config &cfg, bool dry_run, const char *prog)
Resolves ${VAR} in every venue string.
constexpr int kExitLocked
Another process holds the instance lock, or a takeover failed; nothing was traded.
Definition session.hpp:128
constexpr int kExitOk
Process exit codes (listed in fastmm-live --help and docs/how-to/operations/).
Definition session.hpp:120
void restore_signal_handlers() noexcept
Restores the SIGINT/SIGTERM handlers run_live replaced; a no-op when none are replaced.
int run_live(const Config &cfg, const LiveOptions &opts)
Runs one session; returns the process exit code.
constexpr int kExitConfig
bad config, strategy or parameters
Definition session.hpp:122
Definition strategy.hpp:16
Strongly typed identifiers.
Everything a factory needs that is backend-independent.
Definition registry.hpp:51
Definition session.hpp:77
std::function< std::string()> watchdog
Called by the control thread every 50 ms; must not block.
Definition session.hpp:108
bool no_control
Definition session.hpp:88
std::string journal_path
overrides [engine] journal_dir
Definition session.hpp:82
bool no_status
Definition session.hpp:85
bool confine_other_threads
Before the session starts its threads, set every thread of the process to the CPUs not listed in [eng...
Definition session.hpp:111
bool standby
Waits for the instance lock (live/instance_lock.hpp) instead of refusing to start while another proce...
Definition session.hpp:100
std::string config_path
Definition session.hpp:78
std::string program
prefix of error messages (log lines keep fastmm-live:)
Definition session.hpp:104
std::string gateway_path
(live/gateway.hpp): its instrument table, its rings, no venue keys in this process,...
Definition session.hpp:115
bool no_journal
Definition session.hpp:83
std::string control_path
Control socket (live/control_socket.hpp); empty takes <journal_dir>/<engine name>....
Definition session.hpp:87
std::string record_raw_dir
Definition session.hpp:81
bool dry_run
Definition session.hpp:80
const LiveStrategy * strategy
nullptr: [strategy] name from the registry
Definition session.hpp:105
bool takeover
standby, and once ready send handoff to the control socket of the session holding the lock; give up a...
Definition session.hpp:103
std::string status_path
overrides the default /dev/shm/fastmm-<engine>.status
Definition session.hpp:84
bool clear_kill
Removes the durable kill state before starting: clears a latched max-loss trip and arms the whole [ri...
Definition session.hpp:91
std::int64_t duration_ns
0 = until SIGINT/SIGTERM
Definition session.hpp:79
A strategy the caller builds instead of the registry's [strategy] name.
Definition session.hpp:53
std::string meta
the journal's strategy metadata (key=value lines)
Definition session.hpp:56
std::string name
journal header, status file and log lines
Definition session.hpp:54
std::function< std::string(const std::vector< std::pair< std::string, std::string > > &, InstrumentId)> set_params
The control socket's param: validates the (name, value) pairs against this strategy's schema and publ...
Definition session.hpp:74
std::function< std::unique_ptr< IEngineRunner >(RunnerDeps &deps)> make
Builds the runner on deps (deps.backend is a LiveBackend) on the calling thread, after the venues' re...
Definition session.hpp:66
const ParamSchema * params
the journal's parameter table
Definition session.hpp:55
std::function< void(std::function< void()> wake)> set_waker
Called with a function that wakes the engine, before the session's threads start, and with an empty o...
Definition session.hpp:62
std::function< void(IEngineRunner &runner)> finished
Called after the engine thread has stopped, before the runner is destroyed.
Definition session.hpp:68
std::vector< MsgRing * > inputs
Rings the engine polls besides the venues' (parameter updates); the caller keeps them alive.
Definition session.hpp:58