Skip to content
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

Merged
merged 4 commits into from
Jun 13, 2023
Merged

cross-platform fetch_async #25

merged 4 commits into from
Jun 13, 2023

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented May 9, 2023

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 :)

ehttp/Cargo.toml Outdated Show resolved Hide resolved
rust-toolchain Outdated Show resolved Hide resolved
@@ -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.
Copy link
Contributor Author

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* ?

Copy link
Owner

@emilk emilk Jun 13, 2023

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

@Vrixyz Vrixyz requested a review from emilk June 8, 2023 14:19
Copy link
Owner

@emilk emilk left a 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.
Copy link
Owner

@emilk emilk Jun 13, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants