Module: Temporalio::TimeoutType
- Defined in:
- lib/temporalio/timeout_type.rb
Overview
Type of timeout for TimeoutError.
Constant Summary collapse
- TYPES =
[ START_TO_CLOSE = :START_TO_CLOSE, SCHEDULE_TO_START = :SCHEDULE_TO_START, SCHEDULE_TO_CLOSE = :SCHEDULE_TO_CLOSE, HEARTBEAT = :HEARTBEAT, ].freeze
- API_MAP =
RBS screws up style definitions when using .freeze rubocop:disable Style/MutableConstant
{ TIMEOUT_TYPE_START_TO_CLOSE: START_TO_CLOSE, TIMEOUT_TYPE_SCHEDULE_TO_START: SCHEDULE_TO_START, TIMEOUT_TYPE_SCHEDULE_TO_CLOSE: SCHEDULE_TO_CLOSE, TIMEOUT_TYPE_HEARTBEAT: HEARTBEAT, }
Class Method Summary collapse
- .from_raw(raw_type) ⇒ Object
-
.to_raw(type) ⇒ Object
rubocop:enable Style/MutableConstant.
Class Method Details
.from_raw(raw_type) ⇒ Object
25 26 27 |
# File 'lib/temporalio/timeout_type.rb', line 25 def self.from_raw(raw_type) API_MAP[raw_type] end |
.to_raw(type) ⇒ Object
rubocop:enable Style/MutableConstant
21 22 23 |
# File 'lib/temporalio/timeout_type.rb', line 21 def self.to_raw(type) API_MAP.invert[type] || :TIMEOUT_TYPE_UNSPECIFIED end |