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

Should "async" family of functions in txrx only exist for wasm32 arch? #52

Closed
bryanjswift opened this issue Oct 17, 2020 · 2 comments
Closed

Comments

@bryanjswift
Copy link
Contributor

txrx.rs uses use wasm_bindgen_futures::spawn_local; which I think needs to not be included if target_arch is something other than "wasm32"

@schell
Copy link
Owner

schell commented Oct 18, 2020

That's probably a good callout. I haven't run into trouble yet but I don't think I've tried using send_async server-side.

@bryanjswift
Copy link
Contributor Author

I think this is closed with the merge of #53

bryanjswift added a commit to bryanjswift/mogwai that referenced this issue Oct 26, 2020
The `futures::executor::block_on` didn't work inside a `tokio` runtime
which will be too common a scenario to ignore. Outside of implementing a
custom `Waker` to loop and poll the `Future` to completion spawning a
"local" context similar to the wasm32 behavior is more difficult than
anticipated.

Refs schell#52
bryanjswift added a commit to bryanjswift/mogwai that referenced this issue Oct 26, 2020
The `futures::executor::block_on` didn't work inside a `tokio` runtime
which will be too common a scenario to ignore. Outside of implementing a
custom `Waker` to loop and poll the `Future` to completion spawning a
"local" context similar to the wasm32 behavior is more difficult than
anticipated.

Refs schell#52
schell pushed a commit that referenced this issue Oct 30, 2020
* Change `Transmitter::send_async` to log a message for not wasm32

The `futures::executor::block_on` didn't work inside a `tokio` runtime
which will be too common a scenario to ignore. Outside of implementing a
custom `Waker` to loop and poll the `Future` to completion spawning a
"local" context similar to the wasm32 behavior is more difficult than
anticipated.

Refs #52

* Remove `futures` from the dependencies of mogwai

Without the usage in `Transmitter::send_async` the crate is not
necesary.

Closes #57

* Move the `send_async` example to `Transmitter::send_async`

To ensure the example is only compiled for `target_arch = "wasm32"`.
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

2 participants