Skip to main content

isyieldable

Function isyieldable 

Source
pub fn isyieldable() -> boolean
Expand description

Returns true when the running coroutine can yield โ€” that is, when it is not the main coroutine and it is not inside a non-yieldable C function.

ยงExamples

print(coroutine.isyieldable())    --> false   (main coroutine)
coroutine.wrap(function()
  print(coroutine.isyieldable())  --> true
end)()