class WebTaskWorker
extends java.lang.Thread
This helps in releasing the websocket (and thus the javascript's single-thread processing) so JS events can be captured/
Modifier and Type | Field and Description |
---|---|
private boolean |
running
Flag to control thread abort.
|
private java.util.LinkedList<java.lang.Runnable> |
webTasks
List of tasks sent by the JS side.
|
Constructor and Description |
---|
WebTaskWorker()
Create a new worker.
|
Modifier and Type | Method and Description |
---|---|
void |
kill()
Terminate the thread.
|
void |
post(java.lang.Runnable task)
Post the given task to the queue.
|
void |
run()
Listening loop which waits for tasks to be posted to
webTasks . |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private volatile boolean running
private final java.util.LinkedList<java.lang.Runnable> webTasks
public void run()
webTasks
.run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void kill()
public void post(java.lang.Runnable task)
task
- The task.