Moai SDK  2.0
MOAICoroutine Class Reference
+ Inheritance diagram for MOAICoroutine:

Function List

blockOnAction
 
currentThread
 
run
 
setDefaultParent
 
step
 
- Function List inherited from MOAIAction
addChild
 
attach
 
clear
 
defer
 
detach
 
getChildren
 
hasChildren
 
isActive
 
isBusy
 
isDone
 
isPaused
 
pause
 
setAutoStop
 
start
 
stop
 
throttle
 
update
 
- Function List inherited from MOAIInstanceEventSource
getListener
 
setListener
 

Function Documentation

blockOnAction

Skip updating current thread until the specified action is no longer busy. A little more efficient than spinlocking from Lua.


function blockOnAction ( MOAIAction blocker )

Parameters
MOAIActionblocker
Returns
nil
currentThread

Returns the currently running thread (if any).


function currentThread ()

Returns
MOAICoroutine currentThread
run

Starts a thread with a function and passes parameters to it.


function run ( MOAICoroutine self, function threadFunc, ... )

Parameters
MOAICoroutineself
functionthreadFunc
...parameters
Returns
nil
setDefaultParent

This coroutine will be used as the default parent for any actions launched from within this coroutine.


function setDefaultParent ( MOAICoroutine coroutine )

Parameters
MOAICoroutinecoroutine
Returns
nil
step

Resume the coroutine (run until the next call to coroutine.yield () or until the coroutine's main method returns).


function step ( MOAICoroutine coroutine )

Parameters
MOAICoroutinecoroutine
Returns
nil