@FunctionalInterface public interface StepProvider
Step distinguishing between normal (main loop) steps and shutdown steps that are used during the
termination phase of a ShutdownableThread as returned by
Loop#start(..).| Modifier and Type | Method and Description |
|---|---|
static StepProvider |
alwaysProvide(Step step)
Returns a provider for the given step used for both normal and shutdown phase.
|
static Step |
normalStep(StepProvider supplier)
Returns a normal step using the given supplier.
|
Step |
provide(boolean forShutdown)
Returns a step for normal or shutdown use.
|
static Step |
shutdownStep(StepProvider supplier)
Returns a shutdown step using the given supplier.
|
static StepProvider |
silenceDuringShutdown(Step step)
Returns a provider for the given step used only for the normal phase; a
no-OP is returned for
the shutdown phase. |
Step provide(boolean forShutdown)
forShutdown - true if the returned step will be used in the shutdown phase, and false otherwisestatic Step normalStep(StepProvider supplier)
supplier - the supplier that provides the stepstatic Step shutdownStep(StepProvider supplier)
supplier - the supplier that provides the stepstatic StepProvider alwaysProvide(Step step)
step - the step to be returned by the providerstatic StepProvider silenceDuringShutdown(Step step)
no-OP is returned for
the shutdown phase.step - the step to be returned by the provider for the normal phase