com.github.nkzawa.thread
Class EventThread

java.lang.Object
  extended by java.lang.Thread
      extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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.