class Concurrent::Promise

def initialize(opts = {}, &block)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (?Hash opts, ) -> void

This signature was generated using 4 samples from 2 applications.

Other tags:
    See: http://promises-aplus.github.io/promises-spec/ -
    See: http://wiki.commonjs.org/wiki/Promises/A -

Raises:
  • (ArgumentError) - if no block is given

Other tags:
    Yield: - The block operation to be performed asynchronously.

Options Hash: (**opts)
  • :args (object, Array) -- zero or more arguments to be passed
  • :on_reject (Proc) -- rejection handler
  • :on_fulfill (Proc) -- fulfillment handler
  • :parent (Promise) -- the parent `Promise` when building a chain/tree
def initialize(opts = {}, &block)
  opts.delete_if { |k, v| v.nil? }
  super(NULL, opts.merge(__promise_body_from_block__: block), &nil)
end