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

Switch to wasm-timer #1071

Merged
merged 3 commits into from
Apr 25, 2019
Merged

Switch to wasm-timer #1071

merged 3 commits into from
Apr 25, 2019

Conversation

tomaka
Copy link
Member

@tomaka tomaka commented Apr 18, 2019

Close #900

The wasm-timer crate abstracts over tokio_timer and std::time::Instant and make them work in the browser.

We replace all usages of tokio_timer and Instant with this crate.

This might be controversial, as this change is quite invasive.
However, once #1029, #1070, and this PR are all merged, it should be possible to run a WASM example that uses the master branch.

@ghost ghost assigned tomaka Apr 18, 2019
@ghost ghost added the in progress label Apr 18, 2019
Copy link
Contributor

@twittner twittner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the wasm-timer crate make use of WASI and we generally support the wasm32-unknown-wasi target? Maybe a little early and dependent on the timeframe for WASM support you have in mind.

@tomaka
Copy link
Member Author

tomaka commented Apr 24, 2019

While the idea of WASI seems cool, it doesn't really look ready to me yet (example: https://github.com/rust-lang/rust/blob/bfb443eb1de484fde141fa9090a9f4291cbe60a5/src/libstd/sys/wasi/net.rs#L14-L106).
We additionally would need some support from browsers to actually implement WASI, and that doesn't seem to be in the process of happening.

@tomaka tomaka merged commit ce4ca3c into libp2p:master Apr 25, 2019
@ghost ghost removed the in progress label Apr 25, 2019
@tomaka tomaka deleted the wasm-timer branch April 25, 2019 13:08
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.

Abstract over tokio-timer in order to compile for the browser
2 participants