flowmachine.core.server.server_config¶
Class FlowmachineServerConfig¶
FlowmachineServerConfig(port: int, debug_mode: bool, store_dependencies: bool, cache_pruning_frequency: int, cache_pruning_timeout: int, server_thread_pool: concurrent.futures.thread.ThreadPoolExecutor)
A namedtuple for passing server config options within the Flowmachine server.
Attributes¶
-
port
:int
Port on which to listen for messages
-
debug_mode
:bool
True to enable asyncio's debugging mode
-
store_dependencies
:bool
If True, store a query's dependencies when running the query
-
cache_pruning_frequency
:int
Number of seconds to wait between cache shrinks (if negative, no shrinks will ever be done).
-
cache_pruning_timeout
:int
Maximum number of seconds to wait for a cache pruning operation to complete.
-
server_thread_pool
:concurrent.futures.thread.ThreadPoolExecutor
Server's threadpool for managing blocking tasks
get_env_as_bool¶
get_env_as_bool(env_var: str) -> bool
Return a boolean true if the named env var is set to 'true' with any casing, and return False if it is set to anything else or not set at all.
Parameters¶
-
env_var
:str
Name of the environment variable
Returns¶
bool
get_server_config¶
get_server_config() -> flowmachine.core.server.server_config.FlowmachineServerConfig
Read config options from environment variables.
Returns¶
-
flowmachine.core.server.server_config.FlowmachineServerConfig
A namedtuple containing the config options