mod demo_sequence;
mod orchestrator;
use rs_teststand_bridge::ClientTimeout;
use orchestrator::Orchestrator;
const ADDRESS: &str = "127.0.0.1:50751";
fn main() -> Result<(), Box<dyn std::error::Error>> {
let timeout = std::env::args()
.nth(1)
.and_then(|argument| argument.parse().ok())
.map_or_else(ClientTimeout::default, ClientTimeout::from_seconds);
let mut host = Orchestrator::new(ADDRESS, timeout)?;
println!("host listening on {}", host.address());
match timeout.duration() {
Some(limit) => println!("stops {limit:?} after the last client disconnects"),
None => println!("runs until told to stop; no client timeout"),
}
println!(
"open http://{} in a browser; Shutdown ends this process.",
host.address().trim_start_matches("ws://")
);
host.run()
}