Routine
Description:
A singleton record for managing coroutines.
Teal Type: {Job}.
Job
Type: Field.
Description:
An alias for a coroutine thread.
Signature:
type Job = thread
remove
Type: Function.
Description:
Remove a coroutine job from the set and close it if it is still running.
Signature:
remove: function(self: Routine, job: Job): boolean
Parameters:
Parameter | Type | Description |
---|---|---|
job | Job | The Job instance to remove. |
Returns:
Return Type | Description |
---|---|
boolean | True if the job was removed, false otherwise. |
clear
Type: Function.
Description:
Remove all coroutine jobs and close them if they are still running.
Signature:
clear: function(self: Routine)
__call
Type: Metamethod.
Description:
Metamethod to add a new Job to the Routine.
Signature:
metamethod __call: function(self: Routine, job: Job): Job
Parameters:
Parameter | Type | Description |
---|---|---|
job | Job | The Job instance to add. |
Returns:
Return Type | Description |
---|---|
Job | The Job instance that was added. |