Package com.banuba.sdk.internal.threads
Class SimpleThread
java.lang.Object
java.lang.Thread
com.banuba.sdk.internal.BaseWorkThread<SimpleThreadHandler>
com.banuba.sdk.internal.threads.SimpleThread
- All Implemented Interfaces:
Runnable
General thread class for simple solutions
-
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleThreadHandlervoidrunAndWaitForFinish(Runnable runnable) Add a task to the queue and wait when task will be completed<T> TrunAndWaitForResult(Callable<T> callable) Add a task to the queue and wait when task will be completedvoidAdd a task to the queue and run the task asynchronouslyMethods inherited from class com.banuba.sdk.internal.BaseWorkThread
getHandler, postRunClear, preRunInit, releaseHandler, run, shutdown, startAndGetHandlerMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
SimpleThread
Create an instance of the SimpleThread- Parameters:
threadName- name of the current thread
-
-
Method Details
-
constructHandler
- Specified by:
constructHandlerin classBaseWorkThread<SimpleThreadHandler>
-
runAsync
Add a task to the queue and run the task asynchronously -
runAndWaitForResult
Add a task to the queue and wait when task will be completed- Returns:
- result of the task
-
runAndWaitForFinish
Add a task to the queue and wait when task will be completed
-