Sha256: ebc3a16cd49fa4558f25b683049ab735221e1f37549ecbd5cc172d2bd363544a

Contents?: true

Size: 359 Bytes

Versions: 6

Compression:

Stored size: 359 Bytes

Contents

module UV
  class Async
    include Handle

    def initialize(loop, async_ptr, &block)
      @async_block = block

      super(loop, async_ptr)
    end

    def call
      check_result UV.async_send(handle)

      self
    end

    private
    def on_async(handle, status)
      @async_block.call(check_result(status))
    end

    public :callback
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
uvrb-0.2.0 lib/uv/async.rb
uvrb-0.1.4 lib/uv/async.rb
uvrb-0.1.3 lib/uv/async.rb
uvrb-0.1.2 lib/uv/async.rb
uvrb-0.1.1 lib/uv/async.rb
uvrb-0.1.0 lib/uv/async.rb