Skip to content

Commit

Permalink
added spawn function
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Townsend <[email protected]>
  • Loading branch information
brooksmtownsend committed Mar 28, 2023
1 parent 0ab4756 commit f71ad2d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions host_core/native/hostcore_wasmcloud_native/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ static TOKIO: Lazy<tokio::runtime::Runtime> = Lazy::new(|| {
.expect("Failed to start tokio runtime")
});

pub(crate) fn spawn<T>(task: T) -> JoinHandle<T::Output>
where
T: Future + Send + 'static,
T::Output: Send + 'static,
{
TOKIO.spawn(task)
}

const CHONKY_THRESHOLD_BYTES: usize = 1024 * 700; // 700KB

pub(crate) const CORELABEL_ARCH: &str = "hostcore.arch";
Expand Down

0 comments on commit f71ad2d

Please sign in to comment.