WASM: spawn task (#797)

This commit is contained in:
Daniel Granhão
2025-03-24 14:50:46 +00:00
committed by GitHub
parent 95fade5c1c
commit 37979e6052
7 changed files with 55 additions and 0 deletions

25
cli/Cargo.lock generated
View File

@@ -713,6 +713,7 @@ dependencies = [
"thiserror 1.0.69",
"tokio",
"tokio-stream",
"tokio_with_wasm",
"tonic 0.12.3",
"tonic 0.8.3",
"tonic-build 0.8.4",
@@ -4647,6 +4648,30 @@ dependencies = [
"tokio",
]
[[package]]
name = "tokio_with_wasm"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e42d20f41cbfe26740d0c2fb320d44ce7dfa716be135cb663e99a48248a0e897"
dependencies = [
"js-sys",
"tokio",
"tokio_with_wasm_proc",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "tokio_with_wasm_proc"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee80eb7e23abaa636caa9afe6042c6d8a8c0686165b8165f4fbf2988f0dd347f"
dependencies = [
"quote",
"syn 2.0.100",
]
[[package]]
name = "toml"
version = "0.5.11"

25
lib/Cargo.lock generated
View File

@@ -812,6 +812,7 @@ dependencies = [
"thiserror 1.0.69",
"tokio",
"tokio-stream",
"tokio_with_wasm",
"tonic 0.12.3",
"tonic 0.8.3",
"tonic-build 0.8.4",
@@ -5045,6 +5046,30 @@ dependencies = [
"tokio",
]
[[package]]
name = "tokio_with_wasm"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e42d20f41cbfe26740d0c2fb320d44ce7dfa716be135cb663e99a48248a0e897"
dependencies = [
"js-sys",
"tokio",
"tokio_with_wasm_proc",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
]
[[package]]
name = "tokio_with_wasm_proc"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee80eb7e23abaa636caa9afe6042c6d8a8c0686165b8165f4fbf2988f0dd347f"
dependencies = [
"quote",
"syn 2.0.100",
]
[[package]]
name = "toml"
version = "0.5.11"

View File

@@ -36,6 +36,7 @@ rusqlite = { git = "https://github.com/Spxg/rusqlite", rev = "e36644127f31fa6e7e
"bundled",
] }
tokio = { version = "1", default-features = false, features = ["rt", "macros"] }
tokio_with_wasm = { version = "0.8.2", features = ["rt", "macros"] }
sdk-common = { workspace = true }
sdk-macros = { workspace = true }
rusqlite_migration = { git = "https://github.com/hydra-yse/rusqlite_migration", branch = "rusqlite-v0.33.0" }

View File

@@ -29,6 +29,7 @@ use swapper::boltz::proxy::BoltzProxyFetcher;
use tokio::sync::{watch, RwLock};
use tokio::time::MissedTickBehavior;
use tokio_stream::wrappers::BroadcastStream;
use tokio_with_wasm::alias as tokio;
use web_time::Instant;
use x509_parser::parse_x509_certificate;

View File

@@ -15,6 +15,7 @@ use futures_util::{stream::SplitSink, SinkExt, StreamExt};
use log::{debug, error, info, warn};
use tokio::sync::{broadcast, watch};
use tokio::time::MissedTickBehavior;
use tokio_with_wasm::alias as tokio;
impl<P: ProxyUrlFetcher> BoltzSwapper<P> {
async fn send_subscription(

View File

@@ -7,6 +7,7 @@ use log::{info, trace, warn};
use tokio::sync::{broadcast, watch};
use tokio::time::sleep;
use tokio_stream::StreamExt as _;
use tokio_with_wasm::alias as tokio;
use tonic::Streaming;
use self::client::SyncerClient;

View File

@@ -5,6 +5,7 @@ use boltz_client::boltz;
use std::sync::Arc;
use tokio::sync::{broadcast, watch};
use tokio_with_wasm::alias as tokio;
use crate::swapper::{SubscriptionHandler, SwapperStatusStream};