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

example code #2

Open
keredson opened this issue May 14, 2024 · 4 comments
Open

example code #2

keredson opened this issue May 14, 2024 · 4 comments

Comments

@keredson
Copy link

this could use an example for non-async, non-std.

i had to patch in a custom getrandom impl to use:

        #[path = "espidf.rs"] mod imp;

for some reason if #[cfg(target_os = "espidf")] wasn't true. this was in a new cargo generate esp-rs/esp-template.

beyond that, re the async example, depending on sunset-async seems to pull in stuff that depends on std. example:

error[E0463]: can't find crate for `alloc`
  --> /home/derek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-core-0.3.30/src/lib.rs:16:1
   |
16 | extern crate alloc;
   | ^^^^^^^^^^^^^^^^^^^ can't find crate
@mkj
Copy link
Owner

mkj commented May 14, 2024

Yep, I'm keen to add an example for non-async, though I haven't actually tried using it that way myself yet. There might be API changes that could make it more ergonomic, though I think the basics are there for it to work.

Not sure about the target_os = "espidf" issue - sounds like cargo might be confused about targets? I haven't used esp-rs tools much.

At the moment sunset-async crate is intended for std async, and sunset-embassy is for no_std async. sunset-embassy should work with any executor/platform where there is an adequate RawMutex (not just Embassy), sunset-async depend on it for example. I've been thinking of renaming them to something clearer.

@lasiotus
Copy link

lasiotus commented Jun 6, 2024

I would also love to see a non-async std example.

@mkj
Copy link
Owner

mkj commented Jun 13, 2024

Are you more interested in a client or server non-async example?

@lasiotus
Copy link

I'm more interested in a server non-async std example, thanks!

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

No branches or pull requests

3 participants