Difference between revisions of "Coroutine"

From GiderosMobile
Line 3: Line 3:
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 
=== Description ===
 
=== Description ===
Suspends the execution of the calling coroutine. The coroutine cannot be running a C function, a metamethod, or an iterator. Any arguments to yield are passed as extra results to resume.{|-
+
Suspends the execution of the calling coroutine. The coroutine cannot be running a C function, a metamethod, or an iterator. Any arguments to yield are passed as extra results to resume.
 +
{|-
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Methods ===
 
=== Methods ===

Revision as of 10:02, 23 August 2018

Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6

Description

Suspends the execution of the calling coroutine. The coroutine cannot be running a C function, a metamethod, or an iterator. Any arguments to yield are passed as extra results to resume.

Methods

coroutine.create - creates coroutine from function f, returns coroutine
coroutine.resume - continues execution of co, returns bool status plus any values
coroutine.status - returns co status: "running", "suspended" or "dead"
coroutine.wrap - creates coroutine with body f, returns function that resumes co
coroutine.yield - suspend execution of calling coroutine

Events

Constants