com.github.nkzawa.thread
Class EventThread
java.lang.Object
java.lang.Thread
com.github.nkzawa.thread.EventThread
- All Implemented Interfaces:
- Runnable
public class EventThread
- extends Thread
The thread for event loop. All non-background tasks run within this thread.
|
Method Summary |
static void |
exec(Runnable task)
Executes a task in EventThread. |
static boolean |
isCurrent()
check if the current thread is EventThread. |
static void |
nextTick(Runnable task)
Executes a task on the next loop in EventThread. |
| Methods inherited from class java.lang.Thread |
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
isCurrent
public static boolean isCurrent()
- check if the current thread is EventThread.
- Returns:
- true if the current thread is EventThread.
exec
public static void exec(Runnable task)
- Executes a task in EventThread.
- Parameters:
task -
nextTick
public static void nextTick(Runnable task)
- Executes a task on the next loop in EventThread.
- Parameters:
task -
Copyright © 2014. All rights reserved.