diff options
author | 2025-02-11 22:20:16 +0000 | |
---|---|---|
committer | 2025-02-11 22:20:16 +0000 | |
commit | ad0054ea56747abc6454aa81f20b9c0653aa0da1 (patch) | |
tree | 8014b679cee29baaa9b5d103464ed6f91dd1f383 /luz/src/main.rs | |
parent | 36348285317f6e073581479821564ddf825777c7 (diff) | |
download | luz-ad0054ea56747abc6454aa81f20b9c0653aa0da1.tar.gz luz-ad0054ea56747abc6454aa81f20b9c0653aa0da1.tar.bz2 luz-ad0054ea56747abc6454aa81f20b9c0653aa0da1.zip |
actors complete ?
Diffstat (limited to 'luz/src/main.rs')
-rw-r--r-- | luz/src/main.rs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/luz/src/main.rs b/luz/src/main.rs index e7a11a9..7b3815f 100644 --- a/luz/src/main.rs +++ b/luz/src/main.rs @@ -1,3 +1,23 @@ -fn main() { - println!("Hello, world!"); +use std::time::Duration; + +use luz::{CommandMessage, LuzHandle}; +use sqlx::SqlitePool; +use tokio::io::{AsyncReadExt, AsyncWriteExt}; + +#[tokio::main] +async fn main() { + tracing_subscriber::fmt::init(); + let db = SqlitePool::connect("./luz.db").await.unwrap(); + let (luz, mut recv) = + LuzHandle::new("test@blos.sm".try_into().unwrap(), "slayed".to_string(), db); + + tokio::spawn(async move { + while let Some(msg) = recv.recv().await { + println!("{:#?}", msg) + } + }); + + luz.send(CommandMessage::Connect).await.unwrap(); + luz.send(CommandMessage::GetRoster).await.unwrap(); + tokio::time::sleep(Duration::from_secs(15)).await; } |