(await & promises)
Takes a list of promises, and creates a promise that will realise as
:redlobster.promise/realised
when each promise has successfully realised,
or if one or more of the promises fail, fail with the value of the first
failing promise.
If the first argument is the keyword :all
, then instead of failing when
one of the promises fails, it will just wait for all promises to realise
and realise itself with :redlobster.promise/realised
regardless of the
success or failure of any promise.
Takes a list of promises, and creates a promise that will realise as `:redlobster.promise/realised` when each promise has successfully realised, or if one or more of the promises fail, fail with the value of the first failing promise. If the first argument is the keyword `:all`, then instead of failing when one of the promises fails, it will just wait for all promises to realise and realise itself with `:redlobster.promise/realised` regardless of the success or failure of any promise.
(failed? this)
(realise this value)
(realised? this)
(on-realised this on-success on-error)
(realise-error this value)
(on-event ee type)
Creates a promise that fulfills with an event object when the matching event is triggered on the EventEmitter. This promise cannot fail; it will either succeed or never realise.
Creates a promise that fulfills with an event object when the matching event is triggered on the EventEmitter. This promise cannot fail; it will either succeed or never realise.
(timeout promise timeout)
Sets a promise to fail with :redlobster.promise/timeout
after a
specified number of milliseconds.
A promise that has timed out will not throw an error when you try to
realise it, but the realised value will remain
:redlobster.promise/timeout
.
Sets a promise to fail with `:redlobster.promise/timeout` after a specified number of milliseconds. A promise that has timed out will not throw an error when you try to realise it, but the realised value will remain `:redlobster.promise/timeout`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close