FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::live Namespace Reference

Classes

struct  LiveBackend
 
struct  LiveOptions
 
struct  LiveStrategy
 A strategy the caller builds instead of the registry's [strategy] name. More...
 

Functions

int run_live (const Config &cfg, const LiveOptions &opts)
 Runs one session; returns the process exit code.
 
bool resolve_venue_env (Config &cfg, bool dry_run, const char *prog)
 Resolves ${VAR} in every venue string.
 
void restore_signal_handlers () noexcept
 Restores the SIGINT/SIGTERM handlers run_live replaced; a no-op when none are replaced.
 
template<StrategyLike S>
std::unique_ptr< IEngineRunner > make_live_runner (TransportKind kind, RunnerDeps &deps)
 

Variables

constexpr int kExitOk = 0
 Process exit codes (listed in fastmm-live --help and docs/how-to/operations/).
 
constexpr int kExitUsage = 2
 bad command line, missing API keys
 
constexpr int kExitConfig = 3
 bad config, strategy or parameters
 
constexpr int kExitVenue = 4
 venue reference data failed
 
constexpr int kExitRuntime = 5
 cancel_all failed, journal, ring overflow, uncaught error
 
constexpr int kExitKilled = 6
 engine-tripped kill switch with [engine] on_kill = "exit"
 
constexpr int kExitSlowTier = 7
 LiveOptions::watchdog (a Python slow tier failed)
 
constexpr int kExitLocked = 8
 Another process holds the instance lock, or a takeover failed; nothing was traded.
 
constexpr std::int64_t kKilledReminderNs = 10'000'000'000
 How often a session that stays up after a kill ([engine] on_kill = "stay") repeats its ERROR.
 

Function Documentation

◆ run_live()

int fastmm::live::run_live ( const Config &  cfg,
const LiveOptions &  opts 
)

Runs one session; returns the process exit code.

cfg must already have its venue secrets resolved (or cleared for dry-run) and any command-line overrides applied: the journal embeds cfg.effective_toml() and hashes it.

◆ resolve_venue_env()

bool fastmm::live::resolve_venue_env ( Config &  cfg,
bool  dry_run,
const char *  prog 
)

Resolves ${VAR} in every venue string.

With dry_run, an unset variable in api_key or api_secret clears the key; anything else unset, or a venue without keys outside a dry run, prints an error prefixed with prog to stderr and returns false (kExitUsage).

◆ restore_signal_handlers()

void fastmm::live::restore_signal_handlers ( )
noexcept

Restores the SIGINT/SIGTERM handlers run_live replaced; a no-op when none are replaced.

For a child forked during a session, whose control thread does not exist.

◆ make_live_runner()

template<StrategyLike S>
std::unique_ptr< IEngineRunner > fastmm::live::make_live_runner ( TransportKind  kind,
RunnerDeps &  deps 
)

Variable Documentation

◆ kExitOk

constexpr int fastmm::live::kExitOk = 0
inlineconstexpr

Process exit codes (listed in fastmm-live --help and docs/how-to/operations/).

A failed cancel-all wins over every other outcome: orders may still be resting. --duration elapsed or SIGINT/SIGTERM, cancel_all ok

◆ kExitUsage

constexpr int fastmm::live::kExitUsage = 2
inlineconstexpr

bad command line, missing API keys

◆ kExitConfig

constexpr int fastmm::live::kExitConfig = 3
inlineconstexpr

bad config, strategy or parameters

◆ kExitVenue

constexpr int fastmm::live::kExitVenue = 4
inlineconstexpr

venue reference data failed

◆ kExitRuntime

constexpr int fastmm::live::kExitRuntime = 5
inlineconstexpr

cancel_all failed, journal, ring overflow, uncaught error

◆ kExitKilled

constexpr int fastmm::live::kExitKilled = 6
inlineconstexpr

engine-tripped kill switch with [engine] on_kill = "exit"

◆ kExitSlowTier

constexpr int fastmm::live::kExitSlowTier = 7
inlineconstexpr

LiveOptions::watchdog (a Python slow tier failed)

◆ kExitLocked

constexpr int fastmm::live::kExitLocked = 8
inlineconstexpr

Another process holds the instance lock, or a takeover failed; nothing was traded.

◆ kKilledReminderNs

constexpr std::int64_t fastmm::live::kKilledReminderNs = 10'000'000'000
inlineconstexpr

How often a session that stays up after a kill ([engine] on_kill = "stay") repeats its ERROR.