abstract class Promise
- Promise
- Reference
- Object
Direct Known Subclasses
Defined in:
promise.crClass Method Summary
-
.all(promises)
Returns the result of all the promises or the first failure
-
.all(*promises)
Returns the result of all the promises or the first failure
-
.all_common(promises)
Returns the result of all the promises or the first failure
-
.defer(same_thread = false, &block : -> _)
Execute code in the next tick of the event loop and return a promise for obtaining the value
-
.race(promises)
returns the first promise to either reject or complete
-
.race(*promises)
returns the first promise to either reject or complete
-
.race_common(promises)
returns the first promise to either reject or complete
-
.resolve(value)
Returns a resolved promise of the type passed
Instance Method Summary
- #catch(&errback : Exception -> _)
- #finally(&callback : Exception | Nil -> _)
- #then : DeferredPromise(Nil)
-
#type : Class
Interfaces available to generic types
Macro Summary
-
collective_action(name, &block)
this drys up the code dealing with splats and enumerables
- new(type)
- reject(type, reason)
Class Method Detail
def self.defer(same_thread = false, &block : -> _)
#
Execute code in the next tick of the event loop and return a promise for obtaining the value