Sha256: 616ca0103dc05717c136395b24bbd669b4e6df49a6c9ce804384902211505fe0

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

module UV
  class Idle
    include Handle

    def start(&block)
      assert_block(block)
      assert_arity(1, block)

      @idle_block = block

      check_result! UV.idle_start(handle, callback(:on_idle))

      self
    end

    def stop
      check_result! UV.idle_stop(handle)

      self
    end

    private

    def on_idle(handle, status)
      @idle_block.call(check_result(status))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
uvrb-0.2.0 lib/uv/idle.rb