Skip to content

Commit

Permalink
Switch from wasm-timer to fluvio-wasm-timer... (#735)
Browse files Browse the repository at this point in the history
... which addresses the problem from Amanieu/parking_lot#269
by taking the unmerged workaround of tomaka/wasm-timer#13 ,
as wasm-timer appears to be unmaintained.
  • Loading branch information
neacsu authored Aug 13, 2021
1 parent b48f2f1 commit abb4537
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
37 changes: 20 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions common/client-libs/gateway-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion common/client-libs/gateway-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion common/client-libs/validator-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/client-libs/validator-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
}
}

Expand Down

0 comments on commit abb4537

Please sign in to comment.