reown-com / a2

An Asynchronous Apple Push Notification (apns2) Client for Rust
MIT License
150 stars 52 forks source link

async-std support? #70

Closed eminfedar closed 1 year ago

eminfedar commented 1 year ago

Using a2 crate with async-std executor crashes the application. (this is my first impression because I run the same code in the examples/ but in an async-std environment, example works, mine doesn't)

client.send().await gives this error:

thread 'async-std/runtime' panicked at 'called `Option::unwrap()` on a `None` value', /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/hyper-alpn-0.4.0/src/lib.rs:263:29

Is there a "really important" reason depending on tokio runtime? I think if this library become executor agnostic it would be more useful.

Maybe this crate can use surf instead of hyper which can be used both with tokio & async-std: https://crates.io/crates/surf

Thanks for this crate!

link2xt commented 1 year ago

We are successfully using a2 0.6.0 with async-std at https://github.com/deltachat/notifiers