mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-04 04:01:33 +00:00
*: Enable libp2p to run via wasm32-unknown-unknown in the browser (#2320)
Changes needed to get libp2p to run via `wasm32-unknown-unknown` in the browser (both main thread and inside web workers). Replaces wasm-timer with futures-timer and instant. Co-authored-by: Oliver Wangler <oliver@wngr.de>
This commit is contained in:
@ -310,8 +310,8 @@ fn handle_outbound_event(
|
||||
expiring_registrations.extend(registrations.iter().cloned().map(|registration| {
|
||||
async move {
|
||||
// if the timer errors we consider it expired
|
||||
let _ =
|
||||
wasm_timer::Delay::new(Duration::from_secs(registration.ttl as u64)).await;
|
||||
let _ = futures_timer::Delay::new(Duration::from_secs(registration.ttl as u64))
|
||||
.await;
|
||||
|
||||
(registration.record.peer_id(), registration.namespace)
|
||||
}
|
||||
|
Reference in New Issue
Block a user