class Promise::RejectedPromise(Input)
Defined in:
promise/rejected_promise.crConstructors
Instance Method Summary
-
#catch(&errback : Exception -> Exception | Input | DeferredPromise(Input) | RejectedPromise(Input) | ResolvedPromise(Input))
Callback to execute if an error occurs
-
#get : Input
pause the current fiber and wait for the resolution to occur
- #reject(reason)
-
#resolve(value)
defaults for resolved promises
-
#resolved?
Has the promise value been resolved?
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
Instance Method Detail
def catch(&errback : Exception -> Exception | Input | DeferredPromise(Input) | RejectedPromise(Input) | ResolvedPromise(Input))
#
Description copied from class Promise::DeferredPromise(Input)
Callback to execute if an error occurs
def get : Input
#
Description copied from class Promise::DeferredPromise(Input)
pause the current fiber and wait for the resolution to occur
def resolved?
#
Description copied from class Promise::DeferredPromise(Input)
Has the promise value been resolved?