Coroutine

private class
system.Coroutine

Description

The Coroutine class is an interface to the powerful bidirectional coroutine implementation in the Lua runtime.

API overview

Constructor

Coroutine ()

Attributes

Public attributes

alive: Boolean

Functions

Public functions

_create ( f: Function , c: Coroutine ): Object static native
_resume ( thread: Object , args: Vector.<Object> , c: Coroutine ): Object static native
cancel (): Void
create ( f: Function ): Coroutine static

Create a Coroutine with a function that the coroutine will run

resume ( args: Vector.<Object> ): Object

Resume the coroutine, with the provided arguments (these will be used as function parameters on the first invoke of resume or on subsequent resume a single return value to the last yield statement in the coroutine

Constructor

Coroutine ()

Attributes

alive: Boolean

Functions

_create ( f: Function , c: Coroutine ): Object

static native

Parameters

f: Function
c: Coroutine


_resume ( thread: Object , args: Vector.<Object> , c: Coroutine ): Object

static native

Parameters

thread: Object
args: Vector.<Object>
c: Coroutine


cancel (): Void



create ( f: Function ): Coroutine

static

Create a Coroutine with a function that the coroutine will run.

Coroutines start in a suspended state, you must call resume to start them.

Parameters

f: Function The function that the coroutine will run.


getFullTypeName (): String
Inherited from Object

native

Gets the fully qualified type name of the Object. The fully qualified type name includes the package of the type.


Returns

String fully qualified type name of the Object.

getType (): Type
Inherited from Object

native

Gets the Type that describes the Object.


Returns

Type The Type that describes the object.

getTypeName (): String
Inherited from Object

native

Gets the type name of the Object.


Returns

String type name of the Object.

resume ( args: Vector.<Object> ): Object

Resume the coroutine, with the provided arguments (these will be used as function parameters on the first invoke of resume or on subsequent resume a single return value to the last yield statement in the coroutine.

Parameters

args: Vector.<Object>


toString (): String
Inherited from Object

native

Returns a String that describes the Object. This can be overriden to provide extra details when printing objects using trace().


Returns

String String that described the Object.

: