Class: Temporalio::Client::Schedule::Spec::Interval
- Inherits:
-
Object
- Object
- Temporalio::Client::Schedule::Spec::Interval
- Defined in:
- lib/temporalio/client/schedule.rb
Overview
Specification for scheduling on an interval.
Matches times expressed as epoch + (n * every) + offset.
Instance Attribute Summary collapse
-
#every ⇒ Float
Period to repeat the interval.
-
#offset ⇒ Float?
Fixed offset added to each interval period.
Instance Method Summary collapse
-
#initialize(every:, offset: nil) ⇒ Interval
constructor
Create an interval spec.
Constructor Details
#initialize(every:, offset: nil) ⇒ Interval
Create an interval spec.
641 642 643 |
# File 'lib/temporalio/client/schedule.rb', line 641 def initialize(every:, offset: nil) super end |
Instance Attribute Details
#every ⇒ Float
Returns Period to repeat the interval.
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/temporalio/client/schedule.rb', line 628 class Interval # @!visibility private def self._from_proto(raw_int) Schedule::Spec::Interval.new( every: Internal::ProtoUtils.duration_to_seconds(raw_int.interval) || raise, # Never nil offset: Internal::ProtoUtils.duration_to_seconds(raw_int.phase) ) end # Create an interval spec. # # @param every [Float] Period to repeat the interval. # @param offset [Float, nil] Fixed offset added to each interval period. def initialize(every:, offset: nil) super end # @!visibility private def _to_proto Api::Schedule::V1::IntervalSpec.new( interval: Internal::ProtoUtils.seconds_to_duration(every), phase: Internal::ProtoUtils.seconds_to_duration(offset) ) end end |
#offset ⇒ Float?
Returns Fixed offset added to each interval period.
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/temporalio/client/schedule.rb', line 628 class Interval # @!visibility private def self._from_proto(raw_int) Schedule::Spec::Interval.new( every: Internal::ProtoUtils.duration_to_seconds(raw_int.interval) || raise, # Never nil offset: Internal::ProtoUtils.duration_to_seconds(raw_int.phase) ) end # Create an interval spec. # # @param every [Float] Period to repeat the interval. # @param offset [Float, nil] Fixed offset added to each interval period. def initialize(every:, offset: nil) super end # @!visibility private def _to_proto Api::Schedule::V1::IntervalSpec.new( interval: Internal::ProtoUtils.seconds_to_duration(every), phase: Internal::ProtoUtils.seconds_to_duration(offset) ) end end |