TaskBlox

by

TomoT

parallel lib

Properties

No property on this library.

Functions

create(fn: function | coroutine): thread

Creates a new thread with the provided function.


wrap(fn: function): function

Similar to parallel.create(), but wraps the thread in a function that is returned.


defer(fn: function | coroutine, ...: any): thread

Defers a function/coroutine until the end of the current resumption cycle, at which point the function/coroutine is called/resumed with the given arguments.
See task.defer() for more informations.


delay(fn: function | coroutine, duration: number, ...: any): thread

Calls/Resumes the given function/coroutine after a specified amount of time in seconds (duration). The arguments after the second are passed to the function/coroutine.
See task.delay() for more informations.


currentThread(): thread

Returns the current running thread.
See also coroutine.running().


synchronise(): void

See task.synchronise() for more informations.


desynchronise(): void

See task.desynchronise() for more informations.


pause(...: any): Tuple<any>

Stops the current thread until it is resumed by calling thread:resume(). Arguments passed to the thread:resume() are returned by the function in addition with those who were passed to the parallel.pause() function.
See coroutine.yield() for more informations.


wait(duration: number): void

Pauses the current thread the given amount of time in seconds, before resuming it.
See coroutine.yield() for more informations.

thread class Not creatable

Constructor

new(): thread

Properties

No property on this class.

Methods

resume(...: any): Tuple<any> | void

Resumes the current thread with the given arguments. If arguments were passed into parallel.pause() function in the thread, they are returned.
See coroutine.resume() for more informations.


strictResume(...: any): boolean, < Tuple<any> | void >

Similar to thread:resume(), but returns an additional value describing whether the coroutine ran without any errors.
See coroutine.resum() for more informations.


status(): string

Returns the status of the thread.
See coroutine.status() for more informations.


close(): boolean, < string | void >

Closes the thread, putting it in a dead state.
See for more informations.


destroy(): void

Closes the thread, and destroys it.

Events

No events on this class.