Skip to content

Commit

Permalink
tokio mutex avail on wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
zakstucke committed Aug 13, 2024
1 parent 59a7138 commit 67948d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .zetch.lock

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

11 changes: 10 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ rayon = { version = "1", optional = true }
# FEAT: cookies:
wasm-cookies = { version = "0.2", optional = true }

# These features are included in all builds, need tokio sync feature for mutex, which is fine on wasm.
# Wasm supported features: https://docs.rs/tokio/latest/tokio/#wasm-support
[dependencies.tokio]
version = "1"
features = ["sync"]
# These are included on top of above features when not wasm:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
version = "1"
features = ["time", "fs", "process", "rt", "io-util"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
tracing-subscriber-wasm = "0.1.0"
gloo-timers = { version = "0.3", features = ["futures"] }
Expand All @@ -127,7 +137,6 @@ gloo-timers = { version = "0.3", features = ["futures"] }
# This includes threading (non-blocking stuff that can't be used in wasm)
tracing-appender = '0.2'
hostname = "0.3.1"
tokio = { version = '1', features = ["time", "sync", "fs", "process", "rt", "io-util"] }
named-lock = "0.4"

[dev-dependencies]
Expand Down

0 comments on commit 67948d3

Please sign in to comment.