Thread Library
@std/thread Library
Section titled “@std/thread Library”The @std/thread
library allows spawning concurrent tasks.
Function
Section titled “Function”spawn(function, ...args)
— Runs a function asynchronously in a new thread.
Behavior
Section titled “Behavior”- The first argument must be a function.
- The number and types of provided arguments must match the function’s expected parameters.
- Executes the function concurrently without blocking the main thread.
- Errors during execution are logged internally.
Example Nubo code
Section titled “Example Nubo code”import thread from "@std/thread"
fn task(msg: string) -> void { println(msg)}
thread.spawn(task, "Hello from a thread!")