MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / spawn

Method spawn

src/runtime/reactor.rs:288–298  ·  view source on GitHub ↗

Spawn a `Task` on the `Reactor`.

(&self, fut: F)

Source from the content-addressed store, hash-verified

286
287 /// Spawn a `Task` on the `Reactor`.
288 pub fn spawn<F, T>(&self, fut: F) -> Task<T>
289 where
290 F: Future<Output = T> + 'static,
291 T: 'static,
292 {
293 // Safety: 'static constraints satisfy the lifetime requirements
294 #[allow(unsafe_code)]
295 unsafe {
296 self.spawn_unchecked(fut)
297 }
298 }
299
300 pub(super) fn pop_ready_list(&self) -> Option<Runnable> {
301 self.inner.ready_list.lock().unwrap().pop_front()

Callers 4

spawnFunction · 0.80
new_with_configMethod · 0.80
tcp_echo_serverFunction · 0.80
tcp_stream_clientFunction · 0.80

Calls 1

spawn_uncheckedMethod · 0.80

Tested by 2

tcp_echo_serverFunction · 0.64
tcp_stream_clientFunction · 0.64