mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
the basics work
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
extern crate deltachat;
|
||||
|
||||
use async_std::task;
|
||||
|
||||
use std::time;
|
||||
use tempfile::tempdir;
|
||||
|
||||
@@ -41,13 +39,9 @@ async fn main() {
|
||||
println!("info: {:#?}", info);
|
||||
|
||||
let ctx1 = ctx.clone();
|
||||
task::spawn(async move {
|
||||
loop {
|
||||
if let Ok(event) = ctx1.get_next_event() {
|
||||
cb(event);
|
||||
} else {
|
||||
task::sleep(time::Duration::from_millis(100)).await;
|
||||
}
|
||||
std::thread::spawn(move || loop {
|
||||
if let Ok(event) = ctx1.get_next_event() {
|
||||
cb(event);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -62,11 +56,10 @@ async fn main() {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
ctx.configure().await;
|
||||
ctx.configure().await.unwrap();
|
||||
|
||||
println!("------ RUN ------");
|
||||
ctx.run().await;
|
||||
|
||||
ctx.clone().run().await;
|
||||
println!("--- SENDING A MESSAGE ---");
|
||||
|
||||
let contact_id = Contact::create(&ctx, "dignifiedquire", "dignifiedquire@gmail.com")
|
||||
|
||||
Reference in New Issue
Block a user