Handbook
Glossary
fulfill ( value promise: promise -- )
Promises
Prev:
<promise> ( -- promise )
Next:
?promise ( promise -- result )
Vocabulary
concurrency
.
promises
Inputs
value
an
object
promise
a
promise
Outputs
None
Word description
Fulfills a promise by writing a value to it. Any threads waiting for the value are notified.
Errors
Throws an error if the promise has already been fulfilled.
Definition
USING:
accessors
boxes
concurrency.conditions
kernel
threads
typed
;
IN:
concurrency.promises
TYPED:
fulfill
( value promise: promise -- )
[
box>>
]
keep
over
occupied>>
[
promise-already-fulfilled
]
[
[
>box
]
[
threads>>
notify-all
]
bi*
yield
]
if
;