Sha256: 1157bb455f127011470c32ae0a751ea0b372c0a349789f3be29b4d493c45f56a

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

module Fear
  # An object which may eventually be completed and awaited using blocking methods.
  #
  # @abstract
  # @api private
  # @see Fear::Await
  module Awaitable
    # Await +completed+ state of this +Awaitable+
    #
    # @param at_most [Fixnum] maximum timeout in seconds
    # @return [Fear::Awaitable]
    # @raise [Timeout::Error]
    def __ready__(_at_most)
      raise NotImplementedError
    end

    # Await and return the result of this +Awaitable+
    #
    # @param at_most [Fixnum] maximum timeout in seconds
    # @return [any]
    # @raise [Timeout::Error]
    def __result__(_at_most)
      raise NotImplementedError
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fear-1.1.0 lib/fear/awaitable.rb