aboutsummaryrefslogtreecommitdiff
path: root/src/mail/incoming.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail/incoming.rs')
-rw-r--r--src/mail/incoming.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs
new file mode 100644
index 0000000..4455c91
--- /dev/null
+++ b/src/mail/incoming.rs
@@ -0,0 +1,16 @@
+use std::sync::{Arc, Weak};
+use std::time::Duration;
+
+use tokio::sync::watch;
+
+use crate::mail::unique_ident::UniqueIdent;
+use crate::mail::user::User;
+use crate::mail::uidindex::ImapUidvalidity;
+
+pub async fn incoming_mail_watch_process(user: Weak<User>, rx_inbox_id: watch::Receiver<Option<(UniqueIdent, ImapUidvalidity)>>) {
+ while Weak::upgrade(&user).is_some() {
+ eprintln!("User still available");
+ tokio::time::sleep(Duration::from_secs(10)).await;
+ }
+ drop(rx_inbox_id);
+}