[20:6] static extends: object
Defines the possible states of a thread.
[34:14] (extern: com.aussom.stdlib.AThread) extends: object
The Thread class provides cooperative multithreading support in the browser via TeaVM coroutines. Extend this class and override run() to define thread behavior, then call start() to begin execution.
setOnRun (callback Callback)
Sets the callback function to invoke when the thread starts.
Callback The callback to run.this objectstartThread ()
Starts the underlying Java thread. Called by start().
this objectsleep (int MillsToWait = 0)
Suspends the thread for the specified number of milliseconds.
MillsToWait Milliseconds to sleep (default 0).this objectinterrupt ()
Interrupts this thread.
this objectsetPriority (int Priority = 5)
Sets the thread priority (1-10, default 5).
Priority The priority value.this objectsetName (string Name)
Sets the thread name.
Name The name to assign.this objectsetDaemon (bool SetDaemon = true)
Sets whether this thread is a daemon thread.
SetDaemon True to make daemon (default true).this objectstart (callback OnRun = null)
Starts the thread. If no callback has been set via setOnRun(), this method automatically assigns run() as the callback before starting.
OnRun is an optinal callback to run on thread start.this objectisInterrupted ()
Returns true if this thread has been interrupted.
isAlive ()
Returns true if this thread is still alive.
getPriority ()
Returns the thread priority.
join (int MillsToWait = 0)
Waits for this thread to finish. Optionally waits up to MillsToWait ms.
MillsToWait Max milliseconds to wait (default 0 = wait forever).this objectisDaemon ()
Returns true if this thread is a daemon thread.
toString ()
Returns a string representation of this thread.
getId ()
Returns the thread's unique ID.
getThreadState ()
Returns the current state of this thread as a threadState enum value.
getOnRun ()
Returns the currently set run callback, or null if none is set.
[149:14] (extern: com.aussom.stdlib.ATimer) extends: object
The timer class provides one-shot and repeating timer functionality. Under the hood, TeaVM maps java.util.Timer to browser setTimeout calls.
Timer (int TimeMills, callback OnTimeOut)
Creates a new timer.
TimeMills Duration in milliseconds.OnTimeOut Callback to invoke when the timer fires.newTimer (int TimeMills, callback OnTimeOut)
start ()
Starts the timer for a single one-shot firing after the configured duration.
startInterval ()
Starts the timer to fire repeatedly at the configured interval.
stop ()
Stops the timer and cancels any pending firings.
restart ()
Restarts the timer from the beginning with the current duration.
setDuration (int TimeMills)
Sets the timer duration in milliseconds.
TimeMills New duration.getDuration ()
Returns the current timer duration in milliseconds.