Handbook
Glossary
fulfill ( value 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
concurrency.mailboxes
kernel
;
IN:
concurrency.promises
:
fulfill
( value promise -- )
dup
promise-fulfilled?
[
promise-already-fulfilled
]
[
mailbox>>
mailbox-put
]
if
;