Handbook Glossary
factorcode.org
send-synchronous ( message thread -- reply )
Message-passing concurrency ยป Synchronous sends

Next:reply-synchronous ( message synchronous -- )


Vocabulary
concurrency.messaging

Inputs
messagean object
threadan object


Outputs
replyan object


Definition
USING: accessors kernel threads ;

IN: concurrency.messaging

: send-synchronous ( message thread -- reply )
dup self eq?
[ cannot-send-synchronous-to-self ] [
[ <synchronous> dup ] dip send
[ synchronous-reply? ] curry receive-if data>>
] if ;