Switch from wasm-timer to fluvio-wasm-timer... (#735)
... which addresses the problem from https://github.com/Amanieu/parking_lot/issues/269 by taking the unmerged workaround of https://github.com/tomaka/wasm-timer/pull/13 , as wasm-timer appears to be unmaintained.
This commit is contained in:
committed by
GitHub
parent
b48f2f1660
commit
abb4537551
Generated
+20
-17
@@ -1170,6 +1170,21 @@ dependencies = [
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fluvio-wasm-timer"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b768c170dc045fa587a8f948c91f9bcfb87f774930477c6215addf54317f137f"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"js-sys",
|
||||
"parking_lot",
|
||||
"pin-utils",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
@@ -1331,6 +1346,7 @@ name = "gateway-client"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"crypto",
|
||||
"fluvio-wasm-timer",
|
||||
"futures",
|
||||
"gateway-requests",
|
||||
"getrandom 0.2.3",
|
||||
@@ -1342,7 +1358,6 @@ dependencies = [
|
||||
"tungstenite",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"wasm-timer",
|
||||
"wasm-utils",
|
||||
]
|
||||
|
||||
@@ -1794,6 +1809,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4662,6 +4680,7 @@ dependencies = [
|
||||
"cosmos_sdk",
|
||||
"cosmwasm-std",
|
||||
"flate2",
|
||||
"fluvio-wasm-timer",
|
||||
"getrandom 0.2.3",
|
||||
"itertools 0.10.1",
|
||||
"log",
|
||||
@@ -4675,7 +4694,6 @@ dependencies = [
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"url",
|
||||
"wasm-timer",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4828,21 +4846,6 @@ dependencies = [
|
||||
"quote",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-timer"
|
||||
version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"js-sys",
|
||||
"parking_lot",
|
||||
"pin-utils",
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasm-utils"
|
||||
version = "0.1.0"
|
||||
|
||||
@@ -41,8 +41,8 @@ version = "0.4"
|
||||
path = "../../wasm-utils"
|
||||
|
||||
# only import it in wasm. Prefer proper tokio timer in non-wasm
|
||||
[target."cfg(target_arch = \"wasm32\")".dependencies.wasm-timer]
|
||||
version = "0.2"
|
||||
[target."cfg(target_arch = \"wasm32\")".dependencies.fluvio-wasm-timer]
|
||||
version = "0.2.5"
|
||||
|
||||
# this is due to tungstenite using `rand` 0.8 and associated changes in `getrandom` crate
|
||||
# which now does not support wasm32-unknown-unknown target by default.
|
||||
|
||||
@@ -26,7 +26,7 @@ use tungstenite::protocol::Message;
|
||||
use tokio_tungstenite::connect_async;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use wasm_timer;
|
||||
use fluvio_wasm_timer as wasm_timer;
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use wasm_utils::websocket::JSWebsocket;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ reqwest = { version="0.11", features=["json"] }
|
||||
thiserror = "1"
|
||||
log = "0.4"
|
||||
url = "2"
|
||||
wasm-timer = "0.2"
|
||||
fluvio-wasm-timer = "0.2.5"
|
||||
|
||||
# required for nymd-client
|
||||
# at some point it might be possible to make it wasm-compatible
|
||||
|
||||
@@ -141,7 +141,7 @@ impl Client {
|
||||
error!("{}", url)
|
||||
}
|
||||
// Went with only wasm_timer so we can avoid features on the lib, and pulling in tokio
|
||||
wasm_timer::Delay::new(Duration::from_secs(sleep_secs)).await?;
|
||||
fluvio_wasm_timer::Delay::new(Duration::from_secs(sleep_secs)).await?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user