Class: Temporalio::Client::ScheduleHandle
- Inherits:
-
Object
- Object
- Temporalio::Client::ScheduleHandle
- Defined in:
- lib/temporalio/client/schedule_handle.rb
Overview
Handle for interacting with a schedule. This is usually created via #create_schedule or #schedule_handle.
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
ID of the schedule.
Instance Method Summary collapse
-
#backfill(*backfills, rpc_options: nil) ⇒ Object
Backfill the schedule by going through the specified time periods as if they passed right now.
-
#delete(rpc_options: nil) ⇒ Object
Delete this schedule.
-
#describe(rpc_options: nil) ⇒ Schedule::Description
Fetch this schedule’s description.
-
#pause(note: 'Paused via Ruby SDK', rpc_options: nil) ⇒ Object
Pause the schedule and set a note.
-
#trigger(overlap: nil, rpc_options: nil) ⇒ Object
Trigger an action on this schedule to happen immediately.
-
#unpause(note: 'Unpaused via Ruby SDK', rpc_options: nil) ⇒ Object
Unpause the schedule and set a note.
-
#update(rpc_options: nil) {|Parameter| ... } ⇒ Object
Update a schedule using a callback to build the update from the description.
Instance Attribute Details
#id ⇒ String (readonly)
Returns ID of the schedule.
12 13 14 |
# File 'lib/temporalio/client/schedule_handle.rb', line 12 def id @id end |
Instance Method Details
#backfill(*backfills, rpc_options: nil) ⇒ Object
Backfill the schedule by going through the specified time periods as if they passed right now.
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/temporalio/client/schedule_handle.rb', line 26 def backfill( *backfills, rpc_options: nil ) raise ArgumentError, 'At least one backfill required' if backfills.empty? @client._impl.backfill_schedule(Interceptor::BackfillScheduleInput.new( id:, backfills:, rpc_options: )) end |
#delete(rpc_options: nil) ⇒ Object
Delete this schedule.
44 45 46 47 48 49 |
# File 'lib/temporalio/client/schedule_handle.rb', line 44 def delete(rpc_options: nil) @client._impl.delete_schedule(Interceptor::DeleteScheduleInput.new( id:, rpc_options: )) end |
#describe(rpc_options: nil) ⇒ Schedule::Description
Fetch this schedule’s description.
57 58 59 60 61 62 |
# File 'lib/temporalio/client/schedule_handle.rb', line 57 def describe(rpc_options: nil) @client._impl.describe_schedule(Interceptor::DescribeScheduleInput.new( id:, rpc_options: )) end |
#pause(note: 'Paused via Ruby SDK', rpc_options: nil) ⇒ Object
Pause the schedule and set a note.
70 71 72 73 74 75 76 |
# File 'lib/temporalio/client/schedule_handle.rb', line 70 def pause(note: 'Paused via Ruby SDK', rpc_options: nil) @client._impl.pause_schedule(Interceptor::PauseScheduleInput.new( id:, note:, rpc_options: )) end |
#trigger(overlap: nil, rpc_options: nil) ⇒ Object
Trigger an action on this schedule to happen immediately.
84 85 86 87 88 89 90 |
# File 'lib/temporalio/client/schedule_handle.rb', line 84 def trigger(overlap: nil, rpc_options: nil) @client._impl.trigger_schedule(Interceptor::TriggerScheduleInput.new( id:, overlap:, rpc_options: )) end |
#unpause(note: 'Unpaused via Ruby SDK', rpc_options: nil) ⇒ Object
Unpause the schedule and set a note.
98 99 100 101 102 103 104 |
# File 'lib/temporalio/client/schedule_handle.rb', line 98 def unpause(note: 'Unpaused via Ruby SDK', rpc_options: nil) @client._impl.unpause_schedule(Interceptor::UnpauseScheduleInput.new( id:, note:, rpc_options: )) end |
#update(rpc_options: nil) {|Parameter| ... } ⇒ Object
Update a schedule using a callback to build the update from the description.
NOTE: In future versions, the callback may be invoked multiple times in a conflict-resolution loop.
117 118 119 120 121 122 123 |
# File 'lib/temporalio/client/schedule_handle.rb', line 117 def update(rpc_options: nil, &updater) @client._impl.update_schedule(Interceptor::UpdateScheduleInput.new( id:, updater:, rpc_options: )) end |