ZCancellationScope

zio.temporal.workflow.ZCancellationScope
See theZCancellationScope companion object
final class ZCancellationScope

Handle to a cancellation scope created through ZWorkflow.newCancellationScope or ZWorkflow.newDetachedCancellationScope. Supports explicit cancelling of the code a cancellation scope wraps. The code in the CancellationScope has to be executed using run method.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def cancel(): Unit

Cancels the scope as well as all its children

Cancels the scope as well as all its children

Attributes

def cancel(reason: String): Unit

Cancels the scope as well as all its children.

Cancels the scope as well as all its children.

Attributes

reason

human readable reason for the cancellation. Becomes message of the CanceledException thrown.

def cancellationReason: Option[String]

Returns cancellation reason if was specified

Returns cancellation reason if was specified

Attributes

Returns:

optional cancellation reason

Use this promise to perform cancellation of async operations.

Use this promise to perform cancellation of async operations.

Attributes

Returns:

promise that becomes ready when scope is canceled. It contains reason value or null if none was provided.

def isCancelRequested: Boolean

Is scope was asked to cancel through cancel or by a parent scope.

Is scope was asked to cancel through cancel or by a parent scope.

Attributes

Returns:

whether request is canceled or not.

def isDetached: Boolean

When set to false parent thread cancellation causes this one to get canceled automatically. When set to true only call to cancel leads to this scope cancellation.

When set to false parent thread cancellation causes this one to get canceled automatically. When set to true only call to cancel leads to this scope cancellation.

Attributes

def run(): Unit

Executes the code specified in this cancellation scope

Executes the code specified in this cancellation scope

Attributes

Concrete fields

val toJava: CancellationScope