-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cross-platform fetch_async #25
Conversation
@@ -2,6 +2,9 @@ use std::collections::BTreeMap; | |||
|
|||
use crate::{Request, Response}; | |||
|
|||
#[cfg(feature = "native-async")] | |||
use async_channel::{Receiver, Sender}; | |||
|
|||
/// Only available when compiling for native. | |||
/// | |||
/// NOTE: Ok(…) is returned on network error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it different from web ? should we add this note to every fetch*
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is the same on web.
Ok: we got a response, whatever it was
Err: we failed to make the request
I'll update the docs post-merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@@ -2,6 +2,9 @@ use std::collections::BTreeMap; | |||
|
|||
use crate::{Request, Response}; | |||
|
|||
#[cfg(feature = "native-async")] | |||
use async_channel::{Receiver, Sender}; | |||
|
|||
/// Only available when compiling for native. | |||
/// | |||
/// NOTE: Ok(…) is returned on network error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it is the same on web.
Ok: we got a response, whatever it was
Err: we failed to make the request
I'll update the docs post-merge
I wanted to use this crate in an async context, and only wasm had this capability ; my approach is quite naïve but it makes the API easier to use.
Thanks for considering :)