Yuari
Documentation

spawn

Runs fn immediately on a new coroutine. Errors are logged, not propagated.

Syntax

spawn(fn: function) -> nil

Parameters

ParameterTypeDescription
fnfunctionThe function or callback to use.

Returns

TypeDescription
nilThis function does not return a value.

Description

spawn is part of the Core functions library. Core globals are installed in every executor thread and drive output, scheduling and identity.

The operation is performed immediately using the arguments supplied at the call site.

Example

spawn(function()
    print("running in a new coroutine")
end)

Notes

  • Core globals are available in every script.