aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2020-11-22 23:01:28 +0100
committerGustav Sörnäs <gustav@sornas.net>2020-11-22 23:01:28 +0100
commit5788bc84c13ed56324bdc6dc7c61bb0ca12a9256 (patch)
tree4679422a18b45194c89e1c2956e457732a93bf0d /src/main.rs
parentcfc6244b9cb88ec9521ec02dd0119c3b9f9bbee9 (diff)
downloadkodapa-5788bc84c13ed56324bdc6dc7c61bb0ca12a9256.tar.gz
print agenda when reminders are requested
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 6bd2de5..8980b31 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,18 +4,20 @@ mod reminder;
mod slack;
use crate::agenda::AgendaPoint;
+use crate::reminder::ReminderType;
use futures::join;
-use tokio::sync::mpsc;
+use tokio::sync::{mpsc, watch};
#[tokio::main]
async fn main() {
- println!("Hello, world!");
-
let (from_discord, to_slack) = mpsc::unbounded_channel::<AgendaPoint>();
let (from_slack, to_discord) = mpsc::unbounded_channel::<AgendaPoint>();
+ let (reminder_sender, reminder_receiver) = watch::channel(ReminderType::Void);
+
join!(
- discord::handle(from_discord, to_discord),
- slack::handle(from_slack, to_slack),
+ reminder::handle(reminder_sender),
+ discord::handle(from_discord, to_discord, reminder_receiver.clone()),
+ slack::handle(from_slack, to_slack, reminder_receiver),
);
}