#![warn(clippy::pedantic)]
use anyhow::Result;
use kameo::actor::ActorRef;
use sscan::{
lua_vm::messages::ExecuteChunk,
system::{messages::GetActorLuaVM, System},
};
#[tokio::main]
async fn main() -> Result<()> {
let system_actor: ActorRef<System> = kameo::spawn(System::default());
println!("STARTUP: Initialized system actor {}", system_actor.id());
if let Some(lua_vm) = system_actor.ask(GetActorLuaVM).await? {
lua_vm
.ask(ExecuteChunk::using("version() license()"))
.await?;
}
println!("SHUTDOWN: Initiating system shutdown...");
system_actor.stop_gracefully().await?;
Ok(())
}