class Promise::ResolvedPromise(Input)

Defined in:

promise/resolved_promise.cr

Constructors

Instance Method Summary

Instance methods inherited from class Promise::DeferredPromise(Input)

catch(&errback : Exception -> Exception | Input | DeferredPromise(Input) | RejectedPromise(Input) | ResolvedPromise(Input)) catch, finally(&callback : Exception | Nil -> _) finally, get : Input get, raw_value raw_value, reject(reason) reject, resolve(value) resolve, resolved? resolved?, then(callback : Input -> _, errback : Exception -> _)
then(&callback : Input -> _)
then : DeferredPromise(Nil)
then
, type : Class type, type_var type_var

Constructor methods inherited from class Promise::DeferredPromise(Input)

new new

Instance methods inherited from class Promise(Input)

catch(&errback : Exception -> _) catch, finally(&callback : Exception | Nil -> _) finally, then : DeferredPromise(Nil) then, type : Class type

Class methods inherited from class Promise(Input)

all(promises)
all(*promises)
all
, defer(timeout = nil, &block : -> _) defer, map(collection : Enumerable(T), &block : T -> V) forall T, V map, race(promises)
race(*promises)
race
, resolve(value) resolve, timeout(promise : Promise, time : Time::Span) timeout

Macros inherited from class Promise(Input)

collective_action(name, &block) collective_action, new(type, timeout = nil) new, reject(type, reason) reject

Instance methods inherited from class Object

__check_for_promise__ __check_for_promise__

Macros inherited from class Object

__check_if_promise__ __check_if_promise__

Constructor Detail

def self.new(value : Input) #

[View source]

Instance Method Detail

def get : Input #

get the value directly if the promise is resolved


[View source]
def reject(reason) #

[View source]
def resolve(value) #

defaults for resolved promises


[View source]
def resolved? #
Description copied from class Promise::DeferredPromise(Input)

Has the promise value been resolved?


[View source]
def then(&callback : Input -> _) #
Description copied from class Promise::DeferredPromise(Input)

Callback to be executed once the value is available


[View source]