summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorRomeo Disca <romeo.disca@gmail.com>2020-08-08 04:24:43 +0200
committerRomeo Disca <romeo.disca@gmail.com>2020-08-08 12:08:08 +0200
commitf2630bbb255dab230348dff8cedfcef40787e57e (patch)
tree5de013a9b7c0a1a0b822348e88b776cd6a911518 /src/main.rs
parent36bfd7c66ad1332eaedecde3b6273f4db0559103 (diff)
chore: bring everything together
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index bcefc75..581547b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -5,8 +5,13 @@ mod commands;
mod client;
use std::error::Error;
+use std::time::Duration;
+use std::sync::Arc;
+
+use tokio::sync::Mutex;
use client::*;
+use commands::Command;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
@@ -14,10 +19,13 @@ async fn main() -> Result<(), Box<dyn Error>> {
let event = event_handler(|event| { println!("ping response: {:?}", event); });
let event2 = event_handler(|event| { println!("ping response: {:?}", event); });
- let _client = FlicClient::new("127.0.0.1:5551").await?
+ let mut client = FlicClient::new("127.0.0.1:5551").await?
.register_event_handler(event)
.register_event_handler(event2)
;
+
+ client.submit(Command::GetInfo).await;
+ client.listen().await;
Ok(())
}