A new workspace binary. It reads flysim's own configuration (same env file, same FLY_FEED_BIND, FLY_BUS_DIR and idle cadence), subscribes to fly.feed.snapshots as fly-edge with one latest slot and one delivery in flight, turns each publication back into a Snapshot with feedbus::receive and serves it through flysim's feed::router, so hello, wants, drop-oldest and the 2 Hz idle header are flysim's code and the bytes are flysim's bytes. The port is bound only once the first snapshot has arrived, and when the bus goes away every client is dropped and the port unbound, which is what a stopped flysim looks like to the stage; then it reconnects every 500 ms. FLY_EDGE_METRICS_ADDR serves /metrics (fly_frames_sent_total and fly_feed_clients under their flysim names, plus fly_edge_*) and /healthz.
36 lines
1 KiB
TOML
36 lines
1 KiB
TOML
[package]
|
|
name = "fly-edge"
|
|
version.workspace = true
|
|
edition = "2024"
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
publish = false
|
|
description = "The feed WebSocket (:7400) served from flysim's feed bus (FLY_FEED_VIA=bus)."
|
|
|
|
[lib]
|
|
name = "fly_edge"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "fly-edge"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
# The feed server and the bus encoding are flysim's own modules (`feed`, `feedbus`,
|
|
# `snapshot`), so the edge writes the WebSocket bytes with the code flysim uses in direct mode.
|
|
flysim = { path = "../flysim" }
|
|
flybus = { path = "../flybus" }
|
|
|
|
anyhow = "1.0"
|
|
axum = { version = "0.8", features = ["ws"] }
|
|
clap = { version = "4.5", features = ["derive"] }
|
|
tokio = { version = "1", features = ["rt-multi-thread", "net", "sync", "time", "signal", "macros"] }
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
|
|
[dev-dependencies]
|
|
flate2 = { workspace = true }
|
|
futures-util = "0.3"
|
|
serde_json = { workspace = true }
|
|
tempfile = "3"
|
|
tokio-tungstenite = "0.29"
|