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
-
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleThreadHandler
void
runAndWaitForFinish
(Runnable runnable) Add a task to the queue and wait when task will be completed<T> T
runAndWaitForResult
(Callable<T> callable) Add a task to the queue and wait when task will be completedvoid
Add a task to the queue and run the task asynchronouslyMethods inherited from class com.banuba.sdk.internal.BaseWorkThread
getHandler, postRunClear, preRunInit, releaseHandler, run, shutdown, startAndGetHandler
Methods 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:
constructHandler
in 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
-