mirror of
https://github.com/exchanges-lab/tradesync.git
synced 2026-08-04 21:01:23 +08:00
26 lines
809 B
Rust
26 lines
809 B
Rust
use anyhow::Result;
|
|
use nosync::{ModuleA, ModuleB};
|
|
use tracing::info;
|
|
use tracing_subscriber::{EnvFilter, FmtSubscriber};
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
// Configure simple standard output logging
|
|
let subscriber = FmtSubscriber::builder()
|
|
.with_env_filter(EnvFilter::new("info"))
|
|
.finish();
|
|
tracing::subscriber::set_global_default(subscriber)
|
|
.map_err(|e| anyhow::anyhow!("failed to set global tracing subscriber: {e}"))?;
|
|
|
|
info!("--- Running nosync library example ---");
|
|
|
|
// Construct the structs and execute the logic
|
|
let processor = ModuleA::new("example-processor".to_string())?;
|
|
let orchestrator = ModuleB::new(processor)?;
|
|
|
|
orchestrator.run().await?;
|
|
|
|
info!("--- Example execution completed successfully ---");
|
|
Ok(())
|
|
}
|