lib/polyphony/core/global_api.rb
# Spins up a new fiber, running the given block inside an infinite loop. If
# `rate:` or `interval:` parameters are given, the loop is throttled
# accordingly.
#
# @param tag [any] optional tag for the new fiber
# @param rate: [Number, nil] loop rate (times per second)
# @param interval: [Number, nil] interval between consecutive iterations in seconds
# @param &block [Proc] code to run
# @return [Fiber] new fiber
Spins up a new fiber, running the given block inside an infinite loop. If
`rate:` or `interval:` parameters are given, the loop is throttled
accordingly.
Spins up a new fiber running the given block inside an infinite loop . If ` rate : ` or ` interval : ` parameters are given the loop is throttled accordingly .
def spin_loop(tag = nil, rate: nil, interval: nil, &block)
      if rate || interval
        Fiber.current.spin(tag, caller) do
          throttled_loop(rate: rate, interval: interval, &block)
        end
      else
        spin_loop_without_throttling(tag, caller, block)
      end
    end
def spin_loop ( tag = nil , rate : nil , interval : nil , & block ) if rate || interval Fiber . current . spin ( tag , caller ) do throttled_loop ( rate : rate , interval : interval , & block ) end else spin_loop_without_throttling ( tag , caller , block ) end end
Spins up a new fiber, running the given block inside an infinite loop.
Spins up a new fiber running the given block inside an infinite loop .
None
Fiber
tag
optional tag for the new fiber
optional tag for the new fiber
rate
<not_specific>
interval
<not_specific>
block
<not_specific>
rate:
<not_specific>
loop rate (times per second)
loop rate ( times per second )
interval:
<not_specific>
interval between consecutive iterations in seconds
interval between consecutive iterations in seconds
&block
<not_specific>
code to run
code to run