ZWorkflow

zio.temporal.workflow.ZWorkflow$
object ZWorkflow

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def awaitUntil(cond: => Boolean): Unit

Suspends workflow execution until the given predicate holds

Suspends workflow execution until the given predicate holds

Attributes

cond

await condition

Returns:

unblocks when condition becomes true

See also:

Workflow.await

def awaitUntil(timeout: Duration)(cond: => Boolean): Boolean

Suspends workflow execution until either the given predicate holds or timeout elapsed

Suspends workflow execution until either the given predicate holds or timeout elapsed

Attributes

cond

await condition

timeout

await timeout

Returns:

unblocks when condition becomes true or timeout elapsed

See also:

Workflow.await

def awaitWhile(cond: => Boolean): Unit

Suspends workflow execution while the given predicate holds

Suspends workflow execution while the given predicate holds

Attributes

cond

await condition

Returns:

unblocks when condition becomes false

See also:

Workflow.await

def awaitWhile(timeout: Duration)(cond: => Boolean): Boolean

Suspends workflow execution while either the given predicate holds or timeout elapsed

Suspends workflow execution while either the given predicate holds or timeout elapsed

Attributes

cond

await condition

timeout

await timeout

Returns:

unblocks when condition becomes false or timeout elapsed

See also:

Workflow.await

Returns current timestamp

Returns current timestamp

Should be used instead of java.lang.System.currentTimeMillis() to guarantee determinism

Attributes

Returns:

current time millis as ZCurrentTimeMillis

See also:

Workflow.currentTimeMillis()

Retrieves workflow info

Retrieves workflow info

Attributes

Returns:

ZWorkflowInfo

See also:

io.temporal.workflow.WorkflowInfo

Creates a builder of client stub to activities that implement given interface.

Creates a builder of client stub to activities that implement given interface.

Attributes

A

activity interface

Returns:

activity stub builder

Wraps a procedure in a CancellationScope. The procedure receives the wrapping CancellationScope as a parameter. Useful when cancellation is requested from within the wrapped code. The following example cancels the sibling activity on any failure.

Wraps a procedure in a CancellationScope. The procedure receives the wrapping CancellationScope as a parameter. Useful when cancellation is requested from within the wrapped code. The following example cancels the sibling activity on any failure.

Attributes

thunk

code to wrap in the cancellation scope

Returns:

wrapped proc

See also:

Workflow.newCancellationScope

Creates a builder of client stub that can be used to start a child workflow that implements given interface.

Creates a builder of client stub that can be used to start a child workflow that implements given interface.

Attributes

A

workflow interface

Returns:

child workflow stub builder

Creates a CancellationScope that is not linked to a parent scope. ZCancellationScope.run must be called to execute the code the scope wraps. The detached scope is needed to execute cleanup code after a workflow is canceled which cancels the root scope that wraps the @WorkflowMethod invocation. Here is an example usage:

Creates a CancellationScope that is not linked to a parent scope. ZCancellationScope.run must be called to execute the code the scope wraps. The detached scope is needed to execute cleanup code after a workflow is canceled which cancels the root scope that wraps the @WorkflowMethod invocation. Here is an example usage:

Attributes

thunk

parameter to wrap in a cancellation scope.

Returns:

wrapped parameter.

See also:

Workflow.newDetachedCancellationScope

def newExternalWorkflowStub[A : IsWorkflow](workflowId: String): Of[A]

Creates client stub that can be used to communicate to an existing workflow execution.

Creates client stub that can be used to communicate to an existing workflow execution.

Attributes

A

workflow interface

workflowId

id of the workflow to communicate with.

Returns:

external workflow stub

def newExternalWorkflowStub[A : IsWorkflow](workflowExecution: ZWorkflowExecution): Of[A]

Creates client stub that can be used to communicate to an existing workflow execution.

Creates client stub that can be used to communicate to an existing workflow execution.

Attributes

A

workflow interface

workflowExecution

execution of the workflow to communicate with.

Returns:

external workflow stub

def newExternalWorkflowStubProxy[A : IsWorkflow](workflowId: String): Proxy[A]

Creates untyped client stub that can be used to communicate to an existing workflow execution.

Creates untyped client stub that can be used to communicate to an existing workflow execution.

Attributes

workflowId

id of the workflow to communicate with.

Returns:

external workflow stub

def newExternalWorkflowStubProxy[A : IsWorkflow](workflowExecution: ZWorkflowExecution): Proxy[A]

Creates untyped client stub that can be used to communicate to an existing workflow execution.

Creates untyped client stub that can be used to communicate to an existing workflow execution.

Attributes

workflowExecution

execution of the workflow to communicate with.

Returns:

external workflow stub

Creates a builder of client stub to local activities that implement given interface.

Creates a builder of client stub to local activities that implement given interface.

Attributes

A

activity interface

Returns:

local activity stub builder

def randomUUID: UUID

Generated random UUID

Generated random UUID

Should be used instead of UUID.randomUUID() to guarantee determinism

Attributes

Returns:

generated UUID

See also:

Workflow.randomUUID()

def sleep(duration: Duration): Unit

Suspends workflow execution until the given duration elapsed

Suspends workflow execution until the given duration elapsed

Attributes

duration

time to sleep

Returns:

unblocks when duration elapsed

See also:

Workflow.sleep

def upsertSearchAttributes(attrs: Map[String, ZSearchAttribute]): Unit

Adds or updates workflow search attributes.

Adds or updates workflow search attributes.

Attributes

attrs

map of String to ZSearchAttribute value that can be used to search in list APIs

See also:

Workflow.upsertSearchAttributes

def version(changeId: String, minSupported: Int, maxSupported: Int): Int

Returns current workflow version

Returns current workflow version

Attributes

changeId

identifier of a particular change. All calls to getVersion that share a changeId are guaranteed to return the same version number. Use this to perform multiple coordinated changes that should be enabled together.

maxSupported

max version supported for the change

minSupported

min version supported for the change

Returns:

version

See also:

Workflow.getVersion

Concrete fields