A managed thread.
More...
|
static long | getCurrentThreadId () |
| Gets the id for the current thread. More...
|
|
static void | sleep (int millisecondsTimeout) |
| Sleeps the current thread for a specified period of time. More...
|
|
static void | dispatch (final IAction0 action) |
| Dispatches an action to a background thread. More...
|
|
static Future< Object > | delay (long millis) throws Exception |
| Returns a promise that gets resolved after a specified amount of time. More...
|
|
◆ ManagedThread()
Initializes a new instance of the ManagedThread class.
- Parameters
-
loop | The loop to run on the thread. |
◆ delay()
static Future<Object> fm.liveswitch.ManagedThread.delay |
( |
long |
millis | ) |
throws Exception |
|
static |
Returns a promise that gets resolved after a specified amount of time.
- Parameters
-
millis | The length of time to delay in milliseconds. cannot be greater than 2147483646 ms. |
- Returns
- Promise that gets resolved when the delay is complete.
◆ dispatch()
static void fm.liveswitch.ManagedThread.dispatch |
( |
final IAction0 |
action | ) |
|
|
static |
Dispatches an action to a background thread.
- Parameters
-
◆ getCurrentThreadId()
static long fm.liveswitch.ManagedThread.getCurrentThreadId |
( |
| ) |
|
|
static |
Gets the id for the current thread.
◆ loopBegin()
void fm.liveswitch.ManagedThread.loopBegin |
( |
| ) |
|
Should be invoked when the loop begins before other code.
◆ loopEnd()
void fm.liveswitch.ManagedThread.loopEnd |
( |
| ) |
|
Should be invoked when the loop ends after other code.
◆ sleep()
static void fm.liveswitch.ManagedThread.sleep |
( |
int |
millisecondsTimeout | ) |
|
|
static |
Sleeps the current thread for a specified period of time.
- Parameters
-
millisecondsTimeout | The length of time to sleep in milliseconds. |
◆ start()
void fm.liveswitch.ManagedThread.start |
( |
| ) |
|