MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Runtime.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace MayaFlux::Host::Live {
4
5/**
6 * @brief Start a Lila interpreter and TCP server inside this process.
7 *
8 * Constructs a Lila instance and initializes it in OperationMode::Both.
9 * The interpreter skips loading MayaFluxLib because the host process
10 * already has it resident in the symbol table.
11 *
12 * Only one Lila instance is permitted per process. Subsequent calls
13 * while one is already running return false and log a warning.
14 *
15 * JIT'd code evaluated through this session can call any MayaFlux
16 * symbol visible in the process symbol table. Objects constructed
17 * with shorter lifetimes than the host should use MayaFlux::store()
18 * or MayaFlux::make_persistent() to survive declaration-group scoping.
19 *
20 * @param port TCP port for the Lila server to listen on.
21 * @return true on successful start, false otherwise.
22 */
23[[nodiscard]] MAYAFLUX_HOST_API bool start_lila(uint16_t port = 9090);
24
25/**
26 * @brief Stop the running Lila interpreter and TCP server.
27 *
28 * Any JIT'd function pointers obtained through this session become
29 * invalid after this returns.
30 *
31 * @param clear_persistent_store If true, also empties the persistent
32 * store so objects created during the session are released.
33 * Defaults to false so a subsequent start_lila() can resume
34 * against store()-held state.
35 */
36MAYAFLUX_HOST_API void stop_lila(bool clear_persistent_store = false);
37
38/**
39 * @brief True if a Lila instance is currently running in this process.
40 */
41[[nodiscard]] MAYAFLUX_HOST_API bool lila_active();
42
43/**
44 * @brief TCP port of the running Lila instance, or 0 if none is running.
45 */
46[[nodiscard]] MAYAFLUX_HOST_API uint16_t lila_port();
47
48} // namespace MayaFlux::Host::Live
bool lila_active()
True if a Lila instance is currently running in this process.
Definition Runtime.cpp:71
void stop_lila(bool clear_persistent_store)
Stop the running Lila interpreter and TCP server.
Definition Runtime.cpp:50
bool start_lila(uint16_t port)
Start a Lila interpreter and TCP server inside this process.
Definition Runtime.cpp:20
uint16_t lila_port()
TCP port of the running Lila instance, or 0 if none is running.
Definition Runtime.cpp:77