Module: Temporal::Testing::ScheduledWorkflows

Defined in:
lib/temporal/testing/scheduled_workflows.rb

Overview

When Temporal.schedule_workflow is called in a test in local mode, we defer the execution and do not do it automatically. You can execute them or inspect their cron schedules using this module.

Defined Under Namespace

Modules: Private

Class Method Summary collapse

Class Method Details

.clear_allObject



24
25
26
# File 'lib/temporal/testing/scheduled_workflows.rb', line 24

def self.clear_all
  Private::Store.clear_all
end

.cron_schedulesObject

For someone who wants to assert that the schedule is what they expect. Populated by Temporal.schedule_workflow format: { <workflow_id>: <cron schedule string>, … }



20
21
22
# File 'lib/temporal/testing/scheduled_workflows.rb', line 20

def self.cron_schedules
  Private::Store.schedules
end

.execute(workflow_id:) ⇒ Object



9
10
11
# File 'lib/temporal/testing/scheduled_workflows.rb', line 9

def self.execute(workflow_id:)
  Private::Store.execute(workflow_id: workflow_id)
end

.execute_allObject



13
14
15
# File 'lib/temporal/testing/scheduled_workflows.rb', line 13

def self.execute_all
  Private::Store.execute_all
end