Difference between revisions of "Coroutine"

From GiderosMobile
(Created page with "__NOTOC__ '''Supported platforms:''' <br/> '''Available since:''' Gideros 2011.6<br/> === Description === Suspends the execution of the calling coroutine. The coroutine cannot...")
 
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Supported platforms:''' <br/>
+
'''Supported platforms:''' android, ios, mac, pc<br/>
 
'''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 ===
 +
[[coroutine.create]] - creates coroutine from function f, returns coroutine<br/>
 +
[[coroutine.resume]] - continues execution of co, returns bool status plus any values<br/>
 +
[[coroutine.status]] - returns co status: "running", "suspended" or "dead"<br/>
 +
[[coroutine.wrap]] - creates coroutine with body f, returns function that resumes co<br/>
 +
[[coroutine.yield]] - suspend execution of calling coroutine<br/>
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Events ===
 
=== Events ===
 
=== Constants ===
 
=== Constants ===
 
|}
 
|}

Revision as of 09:57, 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