Class: Temporalio::Activity::CancellationDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/temporalio/activity/cancellation_details.rb

Overview

Details that are set when an activity is cancelled. This is only valid at the time the cancel was received, the state may change on the server after it is received.

Instance Method Summary collapse

Constructor Details

#initialize(gone_from_server: false, cancel_requested: true, timed_out: false, worker_shutdown: false, paused: false, reset: false) ⇒ CancellationDetails

Returns a new instance of CancellationDetails.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/temporalio/activity/cancellation_details.rb', line 10

def initialize(
  gone_from_server: false,
  cancel_requested: true,
  timed_out: false,
  worker_shutdown: false,
  paused: false,
  reset: false
)
  @gone_from_server = gone_from_server
  @cancel_requested = cancel_requested
  @timed_out = timed_out
  @worker_shutdown = worker_shutdown
  @paused = paused
  @reset = reset
end

Instance Method Details

#cancel_requested?Boolean

Returns Whether the activity was explicitly cancelled.

Returns:

  • (Boolean)

    Whether the activity was explicitly cancelled.



33
34
35
# File 'lib/temporalio/activity/cancellation_details.rb', line 33

def cancel_requested?
  @cancel_requested
end

#gone_from_server?Boolean

Returns Whether the activity no longer exists on the server (may already be completed or its workflow may be completed).

Returns:

  • (Boolean)

    Whether the activity no longer exists on the server (may already be completed or its workflow may be completed).



28
29
30
# File 'lib/temporalio/activity/cancellation_details.rb', line 28

def gone_from_server?
  @gone_from_server
end

#paused?Boolean

Returns Whether the activity was explicitly paused.

Returns:

  • (Boolean)

    Whether the activity was explicitly paused.



48
49
50
# File 'lib/temporalio/activity/cancellation_details.rb', line 48

def paused?
  @paused
end

#reset?Boolean

Returns Whether the activity was explicitly reset.

Returns:

  • (Boolean)

    Whether the activity was explicitly reset.



53
54
55
# File 'lib/temporalio/activity/cancellation_details.rb', line 53

def reset?
  @reset
end

#timed_out?Boolean

Returns Whether the activity timeout caused activity to be marked cancelled.

Returns:

  • (Boolean)

    Whether the activity timeout caused activity to be marked cancelled.



38
39
40
# File 'lib/temporalio/activity/cancellation_details.rb', line 38

def timed_out?
  @timed_out
end

#worker_shutdown?Boolean

Returns Whether the worker the activity is running on is shutting down.

Returns:

  • (Boolean)

    Whether the worker the activity is running on is shutting down.



43
44
45
# File 'lib/temporalio/activity/cancellation_details.rb', line 43

def worker_shutdown?
  @worker_shutdown
end