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.
633 634 635 |
# File 'lib/temporalio/client/schedule.rb', line 633 def initialize(every:, offset: nil) super end |
Instance Attribute Details
#every ⇒ Float
Returns Period to repeat the interval.
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
# File 'lib/temporalio/client/schedule.rb', line 620 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.
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
# File 'lib/temporalio/client/schedule.rb', line 620 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 |