Module: Flagsmith::SDK::Intervals
- Included in:
- EnvironmentDataPollingManager
- Defined in:
- lib/flagsmith/sdk/intervals.rb
Overview
Util functions
Instance Method Summary collapse
-
#clear_interval(thread) ⇒ Object
rubocop:enable Naming/AccessorMethodName.
-
#set_interval(delay) ⇒ Thread
rubocop:disable Naming/AccessorMethodName.
Instance Method Details
#clear_interval(thread) ⇒ Object
rubocop:enable Naming/AccessorMethodName
19 20 21 |
# File 'lib/flagsmith/sdk/intervals.rb', line 19 def clear_interval(thread) thread.kill end |
#set_interval(delay) ⇒ Thread
rubocop:disable Naming/AccessorMethodName
9 10 11 12 13 14 15 16 |
# File 'lib/flagsmith/sdk/intervals.rb', line 9 def set_interval(delay) Thread.new do loop do sleep delay yield if block_given? end end end |