public interface PausableFiber extends Fiber
This interface defines an extension to the core Fiberinterface
and adds the methods for pausing and resuming an executable context. The base
interface class defines an execution environment, this interface extends the
core interface to provide methods for suspending and resuming the
Fiber.
| Modifier and Type | Field and Description |
|---|---|
static int |
PAUSE_PENDING
This state is used to define when a
Fiber has begun the
process of pausing its operations. |
static int |
PAUSED
This state is used to denote a paused, or otherwise suspended
Fiber. |
static int |
RESUME_PENDING
This state is used to denote a
Fiber recovering from a
paused state to a running status. |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED| Modifier and Type | Method and Description |
|---|---|
void |
pause()
This method is used to suspend a currently running
Fiber. |
void |
resume()
This method is used to resume a suspeneded
Fiber. |
static final int PAUSE_PENDING
Fiber has begun the
process of pausing its operations. This is the intermedate period where
the thread is no longer in the RUNNING status, but not yet
to a PAUSED status.static final int PAUSED
Fiber. When a Fiber is in this state it
should not be preforming any work.static final int RESUME_PENDING
Fiber recovering from a
paused state to a running status. During this status the
Fiber is reinitializing any necessary internal elements to
re-enter the RUNNING state.void pause()
Fiber.
When invoked the Fiber will begin the transition to
a PAUSED status after changing its internal state, if
applicable.void resume()
Fiber. If the
thread is already running then this method should have no effect on the
current Fiber.Copyright © 2020. All rights reserved.