Coroutine API
|
|||||||||
| Creates a thread from a function. | |||||||||
| Syntax | coroutine.create(
|
||||||||
| Returns | thread | ||||||||
| Part of | Lua | ||||||||
| API | Base globals | ||||||||
| |||||||||
|
|||||||||||
| Resumes a coroutine. | |||||||||||
| Syntax | coroutine.resume(
|
||||||||||
| Returns | boolean | ||||||||||
| Part of | Lua | ||||||||||
| API | Base globals | ||||||||||
| |||||||||||
|
|||||||||||
| Returns the currently running coroutine, or nil if running outside a coroutine. | |||||||||||
| Syntax | coroutine.running() | ||||||||||
| Returns | thread | ||||||||||
| Part of | Lua | ||||||||||
| API | coroutine | ||||||||||
| |||||||||||
Coroutine.status Coroutine.wrap
How To Use Coroutines
|
|||
| Takes arguments {...} and makes the coroutine.resume call executing the coroutine calling this to return them (usually, this is just a single string acting as a filter for the type of event desired). Usually you should use os.pullEvent and os.pullEventRaw instead. | |||
| Syntax | coroutine.yield(
|
||
| Returns | {...} | ||
| Part of | CC:Tweaked | ||
| API | coroutine | ||
| See also | os.pullEvent | ||
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.