public interface WorkflowThread extends CancellationScope
DeterministicRunner
.Modifier and Type | Method and Description |
---|---|
void |
addStackTrace(java.lang.StringBuilder result) |
static void |
await(java.lang.String reason,
java.util.function.Supplier<java.lang.Boolean> unblockCondition)
Block current thread until unblockCondition is evaluated to true.
|
static <R> void |
exit(R value)
Stop executing all workflow threads and puts
DeterministicRunner into closed state. |
<R> void |
exitThread(R value) |
long |
getId() |
java.lang.String |
getName() |
int |
getPriority() |
io.temporal.internal.sync.DeterministicRunnerImpl |
getRunner() |
java.lang.String |
getStackTrace() |
<T> java.util.Optional<T> |
getThreadLocal(WorkflowThreadLocalInternal<T> key) |
java.lang.Throwable |
getUnhandledException() |
io.temporal.internal.sync.SyncWorkflowContext |
getWorkflowContext() |
WorkflowThreadContext |
getWorkflowThreadContext() |
boolean |
isDone() |
boolean |
isStarted() |
static WorkflowThread |
newThread(java.lang.Runnable runnable,
boolean detached)
Creates a new thread instance.
|
static WorkflowThread |
newThread(java.lang.Runnable runnable,
boolean detached,
java.lang.String name) |
boolean |
runUntilBlocked(long deadlockDetectionTimeout) |
void |
setName(java.lang.String name) |
<T> void |
setThreadLocal(WorkflowThreadLocalInternal<T> key,
T value) |
void |
start() |
java.util.concurrent.Future<?> |
stopNow() |
void |
yield(java.lang.String reason,
java.util.function.Supplier<java.lang.Boolean> unblockCondition) |
cancel, cancel, current, getCancellationReason, getCancellationRequest, isCancelRequested, isDetached, throwCanceled
static void await(java.lang.String reason, java.util.function.Supplier<java.lang.Boolean> unblockCondition) throws io.temporal.internal.sync.DestroyWorkflowThreadError
reason
- reason for blockingunblockCondition
- condition that should return true to indicate that thread should
unblock.CanceledFailure
- if thread (or current cancellation scope was canceled).DestroyWorkflowThreadError
- if thread was asked to be destroyed.static WorkflowThread newThread(java.lang.Runnable runnable, boolean detached)
runnable
- thread function to rundetached
- If this thread is detached from the parent CancellationScope
static WorkflowThread newThread(java.lang.Runnable runnable, boolean detached, java.lang.String name)
void start()
boolean isStarted()
void setName(java.lang.String name)
java.lang.String getName()
long getId()
int getPriority()
java.lang.String getStackTrace()
io.temporal.internal.sync.DeterministicRunnerImpl getRunner()
io.temporal.internal.sync.SyncWorkflowContext getWorkflowContext()
boolean runUntilBlocked(long deadlockDetectionTimeout)
java.lang.Throwable getUnhandledException()
boolean isDone()
java.util.concurrent.Future<?> stopNow()
void addStackTrace(java.lang.StringBuilder result)
void yield(java.lang.String reason, java.util.function.Supplier<java.lang.Boolean> unblockCondition) throws io.temporal.internal.sync.DestroyWorkflowThreadError
io.temporal.internal.sync.DestroyWorkflowThreadError
static <R> void exit(R value)
DeterministicRunner
into closed state. To
be called only from a workflow thread.value
- accessible through DeterministicRunner.getExitValue()
.<R> void exitThread(R value)
<T> void setThreadLocal(WorkflowThreadLocalInternal<T> key, T value)
<T> java.util.Optional<T> getThreadLocal(WorkflowThreadLocalInternal<T> key)
WorkflowThreadContext getWorkflowThreadContext()