Skip to main content

Module handlers

Module handlers 

Source
Expand description

RPC handler implementations for the backtest server.

Each handler receives a request message, processes it against the shared server state (symbol registry, profile registry, Parquet store), and returns a response message. Errors are captured in the response rather than crashing the server.

Structs§

AcceptedBacktestJobInput
BacktestJob
Internal representation of an async backtest job.
JobCancellationToken
Lightweight per-job cancellation token without an additional runtime dependency.
ServerState
Shared state accessible by all client handlers.
StrategyServiceState
Configured strategy limits plus the gate that lets only one parameter search hold its market data in memory at a time.

Enums§

AcceptedJobInput
Validated input a retained job runs once its worker starts.
JobKind
What a retained job produces, which decides the endpoint that returns its output.
JobStatus
Typed job status for the async backtest API.

Functions§

cancel_active_jobs
Cooperatively cancel every active job during server shutdown.
cleanup_expired_jobs
Remove terminal jobs older than retention and enforce the configured bound.
handle_add_profile
Handle add_profile — add or overwrite a management profile at runtime.
handle_cancel_backtest
Handle cancel_backtest — cancel a submitted job.
handle_delete_result_artifact
Delete a complete result artifact.
handle_get_backtest_result
Handle get_backtest_result — fetch the result of a completed job.
handle_get_backtest_status
Handle get_backtest_status — poll the status of a submitted job.
handle_get_result_artifact_chunk
Return one base64-encoded raw result artifact chunk.
handle_get_search_result
Handle get_search_result: return a completed search’s summary and the artifact holding its output.
handle_list_profiles
Handle list_profiles — returns all loaded management profiles.
handle_list_symbols
Handle list_symbols — returns available data from the Parquet store.
handle_ping
Handle ping — returns server status and uptime.
handle_reload_profiles
Handle reload_profiles — reload profiles from the configured TOML file.
handle_remove_profile
Handle remove_profile — remove a management profile by name.
handle_run_backtest
Handle the canonical FutureQuoteV1 execution endpoint.
handle_run_backtest_multi
handle_run_configured_strategy
Handle run_configured_strategy: validate, run, and return the result synchronously.
handle_run_portfolio
Handle run_portfolio: validate, run, and return the shared result synchronously.
handle_submit_backtest
handle_submit_configured_strategy
Handle submit_configured_strategy: validate completely, then admit a retained job.
handle_submit_portfolio
Handle submit_portfolio: validate every instance and policy, then admit a retained job.
handle_submit_search
Handle submit_search: validate the whole search without loading data, then admit a retained job.
run_job_and_store
subscribe_backtest_status
Subscribe to the current and future coalesced snapshots of a retained job.
watch_backtest_stream
Build the server stream for a retained backtest job.