-
- All Implemented Interfaces:
-
com.facebook.react.bridge.queue.MessageQueueThread
public class MessageQueueThreadImpl implements MessageQueueThread
Encapsulates a Thread that has a Looper running on it that can accept Runnables.
-
-
Method Summary
Modifier and Type Method Description boolean
runOnQueue(Runnable runnable)
Runs the given Runnable on this Thread. <T> Future<T>
callOnQueue(Callable<T> callable)
Runs the given Callable on this Thread. boolean
isOnThread()
void
assertIsOnThread()
Asserts isOnThread, throwing a AssertionException (NOT an ) if the assertion fails. void
assertIsOnThread(String message)
Asserts isOnThread, throwing a AssertionException (NOT an ) if the assertion fails. void
quitSynchronous()
Quits this queue's Looper. MessageQueueThreadPerfStats
getPerfStats()
Returns the perf counters taken when the framework was started. void
resetPerfStats()
Resets the perf counters. Looper
getLooper()
String
getName()
static MessageQueueThreadImpl
create(MessageQueueThreadSpec spec, QueueThreadExceptionHandler exceptionHandler)
-
-
Method Detail
-
runOnQueue
boolean runOnQueue(Runnable runnable)
Runs the given Runnable on this Thread. It will be submitted to the end of the event queue evenif it is being submitted from the same queue Thread.
-
callOnQueue
<T> Future<T> callOnQueue(Callable<T> callable)
Runs the given Callable on this Thread. It will be submitted to the end of the event queue evenif it is being submitted from the same queue Thread.
-
isOnThread
boolean isOnThread()
-
assertIsOnThread
void assertIsOnThread()
Asserts isOnThread, throwing a AssertionException (NOT an ) if the assertion fails.
-
assertIsOnThread
void assertIsOnThread(String message)
Asserts isOnThread, throwing a AssertionException (NOT an ) if the assertion fails.
-
quitSynchronous
void quitSynchronous()
Quits this queue's Looper. If that Looper was running on a different Thread than the currentThread, also waits for the last message being processed to finish and the Thread to die.
-
getPerfStats
MessageQueueThreadPerfStats getPerfStats()
Returns the perf counters taken when the framework was started. This method is intended to beused for instrumentation purposes.
-
resetPerfStats
void resetPerfStats()
Resets the perf counters. This is useful if the RN threads are being re-used. This method isintended to be used for instrumentation purposes.
-
create
static MessageQueueThreadImpl create(MessageQueueThreadSpec spec, QueueThreadExceptionHandler exceptionHandler)
-
-
-
-