[23:6] static extends: object
Defines the state of the thread. One of these should be returned from getThreadState.
[43:14] (extern: com.lehman.aussomserver.stdlib.AussomThread) extends: object
The thread class implements threading functionality. The
Aussom-Server implementation mirrors the Aussom CLI Thread API
exactly so apps that use threads work the same way under both
runtimes.
Server-only behavior: when started, threads are registered with
the per-app LiveResources tracker so reload and shutdown can
join them, and the default thread name is namespaced as
"aussom-app-
setOnRun (callback Callback)
Sets the on run callback function.
Callback is the function to be called on run.This object.startThread ()
Starts the thread.
This object.sleep (int MillsToWait = 0)
Sleeps the provided number of milliseconds.
MillsToWait is an int with the number of milliseconds to wait.This object.interrupt ()
Interrupts the thread.
This object.setPriority (int Priority = 5)
Sets the priority of the thread.
Priority is an int with the priority to set.This object.setName (string Name)
Sets the thread name.
Name is a string to set for the thread name.This object.setDaemon (bool SetDaemon = true)
Sets the thread as a daemon. The thread cannot already be alive when this is called.
SetDaemon is a bool with the flag.This object.start ()
Starts the thread. If no on-run callback has been set this binds the user's overridden run() method.
This object.run ()
Default run() to override. The base prints a warning and exits so a misconfigured Thread is loud in logs.
isInterrupted ()
Gets the is interrupted flag.
A bool with the is interrupted flag.isAlive ()
Gets the is alive flag.
A bool with the is alive flag.getPriority ()
Gets the thread priority.
An int with the thread priority.join (int MillsToWait = 0)
Joins the thread, waiting up to MillsToWait milliseconds. 0 waits forever.
MillsToWait is an int with the milliseconds to wait.This object.isDaemon ()
Gets the is daemon flag.
A bool with the is daemon flag.toString ()
Returns the Java representation of the thread.
A string with the thread info.getId ()
Gets the thread ID.
An int with the thread ID.getThreadState ()
Gets the thread state.
A string with the thread state. See the threadState enum for available values.getOnRun ()
Gets the on run function.
A callback with the on run function.[180:14] (extern: com.lehman.aussomserver.stdlib.AussomTimer) extends: object
The Timer class implements timer functionality. Mirrors the Aussom CLI Timer API. Server-only behavior: timers are registered with the per-app LiveResources tracker on start so a reload of the owning app can cancel them. Timer callbacks are wrapped in a try/catch so a throwing callback does not silently kill the underlying java.util.Timer thread (a footgun on a long-running server).
Timer (int TimeMills, callback OnTimeOut)
Constructs a new Timer.
TimeMills is the number of milliseconds for the timer.OnTimeOut is a callback fired when the timer elapses.This object.newTimer (int TimeMills, callback OnTimeOut)
start ()
Starts the timer to run only once.
This object.startInterval ()
Starts the timer to run repeatedly at the configured interval.
This object.stop ()
Stops the timer.
This object.restart ()
Restarts a one-shot timer.
This object.setDuration (int TimeMills)
Sets the timer duration in milliseconds.
TimeMills is an int with the duration.This object.getDuration ()
Gets the timer duration.
An int with the duration in milliseconds.