-
Notifications
You must be signed in to change notification settings - Fork 949
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(websocket-websys): Add support for different WASM environments
Add support different WASM environments (such as workers, NodeJS) that don't have a `window` global. This is done by binding to the global `setInterval` and `clearInterval` functions directly. This uses the same approach used by gloo-timers implemented in [rustwasm/gloo#185](rustwasm/gloo#185) and [rustwasm/gloo#283](rustwasm/gloo#283) given the `web-sys` lack of interes to support this (see discussion in [this issue](rustwasm/wasm-bindgen#1046)). Co-authored-by: sisou <[email protected]>
- Loading branch information
Showing
3 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "libp2p-websocket-websys" | |
edition = "2021" | ||
rust-version = "1.60.0" | ||
description = "WebSocket for libp2p under WASM environment" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
authors = ["Vince Vasta <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/libp2p/rust-libp2p" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters