the basics work

This commit is contained in:
dignifiedquire
2020-03-18 15:11:36 +01:00
parent 94c6a01420
commit f85b14a7f7
8 changed files with 504 additions and 533 deletions

View File

@@ -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")