Class: Temporalio::Client::Schedule::Spec

Inherits:
Data
  • Object
show all
Defined in:
lib/temporalio/client/schedule.rb,
lib/temporalio/client/schedule.rb

Overview

Specification of the times scheduled actions may occur.

The times are the union of #calendars, #intervals, and #cron_expressions excluding anything in #skip.

Defined Under Namespace

Classes: Calendar, Interval

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(calendars: [], intervals: [], cron_expressions: [], skip: [], start_at: nil, end_at: nil, jitter: nil, time_zone_name: nil) ⇒ Spec

Create a spec.

Parameters:

  • calendars (Array<Calendar>) (defaults to: [])

    Calendar-based specification of times.

  • intervals (Array<Interval>) (defaults to: [])

    Interval-based specification of times.

  • cron_expressions (Array<String>) (defaults to: [])

    Cron-based specification of times. This is provided for easy migration from legacy string-based cron scheduling. New uses should use ‘calendars` instead. These expressions will be translated to calendar-based specifications on the server.

  • skip (Array<Calendar>) (defaults to: [])

    Set of matching calendar times that will be skipped.

  • start_at (Time, nil) (defaults to: nil)

    Time before which any matching times will be skipped.

  • end_at (Time, nil) (defaults to: nil)

    Time after which any matching times will be skipped.

  • jitter (Float, nil) (defaults to: nil)

    Jitter to apply each action. An action’s scheduled time will be incremented by a random value between 0 and this value if present (but not past the next schedule).

  • time_zone_name (String, nil) (defaults to: nil)

    IANA time zone name, for example ‘US/Central`.



503
504
505
506
507
508
509
510
511
512
513
514
# File 'lib/temporalio/client/schedule.rb', line 503

def initialize(
  calendars: [],
  intervals: [],
  cron_expressions: [],
  skip: [],
  start_at: nil,
  end_at: nil,
  jitter: nil,
  time_zone_name: nil
)
  super
end

Instance Attribute Details

#calendarsArray<Calendar>

Returns Calendar-based specification of times.

Returns:

  • (Array<Calendar>)

    Calendar-based specification of times.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def calendars
  @calendars
end

#cron_expressionsArray<String>

Returns Cron-based specification of times. This is provided for easy migration from legacy string-based cron scheduling. New uses should use ‘calendars` instead. These expressions will be translated to calendar-based specifications on the server.

Returns:

  • (Array<String>)

    Cron-based specification of times. This is provided for easy migration from legacy string-based cron scheduling. New uses should use ‘calendars` instead. These expressions will be translated to calendar-based specifications on the server.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def cron_expressions
  @cron_expressions
end

#end_atTime?

Returns Time after which any matching times will be skipped.

Returns:

  • (Time, nil)

    Time after which any matching times will be skipped.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def end_at
  @end_at
end

#intervalsArray<Interval>

Returns Interval-based specification of times.

Returns:

  • (Array<Interval>)

    Interval-based specification of times.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def intervals
  @intervals
end

#jitterFloat?

Returns Jitter to apply each action. An action’s scheduled time will be incremented by a random value between 0 and this value if present (but not past the next schedule).

Returns:

  • (Float, nil)

    Jitter to apply each action. An action’s scheduled time will be incremented by a random value between 0 and this value if present (but not past the next schedule).



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def jitter
  @jitter
end

#skipArray<Calendar>

Returns Set of matching calendar times that will be skipped.

Returns:

  • (Array<Calendar>)

    Set of matching calendar times that will be skipped.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def skip
  @skip
end

#start_atTime?

Returns Time before which any matching times will be skipped.

Returns:

  • (Time, nil)

    Time before which any matching times will be skipped.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def start_at
  @start_at
end

#time_zone_nameString?

Returns IANA time zone name, for example ‘US/Central`.

Returns:

  • (String, nil)

    IANA time zone name, for example ‘US/Central`.



475
476
477
# File 'lib/temporalio/client/schedule.rb', line 475

def time_zone_name
  @time_zone_name
end