mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-12-16 08:14:26 -05:00
fix wasm
This commit is contained in:
parent
fdbb4c6397
commit
d3f872eb1f
3 changed files with 15 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
use crate::xx::*;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
|
|
||||||
struct BlockStoreInner {
|
struct BlockStoreInner {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
|
use super::*;
|
||||||
|
|
||||||
use crate::intf::table_db::*;
|
use crate::intf::table_db::*;
|
||||||
|
use crate::xx::*;
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use keyvaluedb_web::*;
|
use keyvaluedb_web::*;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ impl<T> MustJoinHandle<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused_mut)]
|
||||||
pub async fn abort(mut self) {
|
pub async fn abort(mut self) {
|
||||||
if !self.completed {
|
if !self.completed {
|
||||||
cfg_if! {
|
cfg_if! {
|
||||||
|
|
@ -31,7 +32,13 @@ impl<T> MustJoinHandle<T> {
|
||||||
let _ = jh.await;
|
let _ = jh.await;
|
||||||
self.completed = true;
|
self.completed = true;
|
||||||
}
|
}
|
||||||
|
} else if #[cfg(target_arch = "wasm32")] {
|
||||||
|
drop(self.join_handle.take());
|
||||||
|
self.completed = true;
|
||||||
|
} else {
|
||||||
|
compile_error!("needs executor implementation")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -58,6 +65,10 @@ impl<T: 'static> Future for MustJoinHandle<T> {
|
||||||
Poll::Ready(t)
|
Poll::Ready(t)
|
||||||
} else if #[cfg(feature="rt-tokio")] {
|
} else if #[cfg(feature="rt-tokio")] {
|
||||||
Poll::Ready(t.unwrap())
|
Poll::Ready(t.unwrap())
|
||||||
|
}else if #[cfg(target_arch = "wasm32")] {
|
||||||
|
Poll::Ready(t)
|
||||||
|
} else {
|
||||||
|
compile_error!("needs executor implementation")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue