<commit_before>! Copyright (C) 2006 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup
threads kernel arrays quotations strings ;
IN: concurrency.messaging

HELP: send
{ $values { "message" object }
          { "thread" thread }
}
{ $description "Send the message to the thread by placing it in the thread's mailbox. This is an asynchronous operation and will return immediately. The receiving thread will act on the message the next time it retrieves that item from its mailbox (usually using the " { $link receive } " word. The message can be any Factor object. For destinations that are instances of remote-thread the message must be a serializable Factor type." }
{ $see-also receive receive-if } ;

HELP: receive
{ $values { "message" object }
}
{ $description "Return a message from the current thread's mailbox. If the box is empty, suspend the thread until another thread places an item in the mailbox (usually via the " { $link send } " word)." }
{ $see-also send receive-if } ;

HELP: receive-if
{ $values { "pred" "a predicate with stack effect " { $snippet "( obj -- ? )" } }
          { "message" object }
}
{ $description "Return the first message from the current thread's mailbox that satisfies the predicate. To satisfy the predicate, " { $snippet "pred" } " is called with the item on the stack and the predicate should leave a boolean indicating whether it was satisfied or not. If nothing in the mailbox satisfies the predicate then the thread will block until something does." }
{ $see-also send receive } ;<commit_msg>concurrency.messaging-docs: add a missing parenthesis<commit_after>! Copyright (C) 2006 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: help.syntax help.markup
threads kernel arrays quotations strings ;
IN: concurrency.messaging

HELP: send
{ $values { "message" object }
          { "thread" thread }
}
{ $description "Send the message to the thread by placing it in the thread's mailbox. This is an asynchronous operation and will return immediately. The receiving thread will act on the message the next time it retrieves that item from its mailbox (usually using the " { $link receive } " word). The message can be any Factor object. For destinations that are instances of remote-thread the message must be a serializable Factor type." }
{ $see-also receive receive-if } ;

HELP: receive
{ $values { "message" object }
}
{ $description "Return a message from the current thread's mailbox. If the box is empty, suspend the thread until another thread places an item in the mailbox (usually via the " { $link send } " word)." }
{ $see-also send receive-if } ;

HELP: receive-if
{ $values { "pred" "a predicate with stack effect " { $snippet "( obj -- ? )" } }
          { "message" object }
}
{ $description "Return the first message from the current thread's mailbox that satisfies the predicate. To satisfy the predicate, " { $snippet "pred" } " is called with the item on the stack and the predicate should leave a boolean indicating whether it was satisfied or not. If nothing in the mailbox satisfies the predicate then the thread will block until something does." }
{ $see-also send receive } ;
{'fraction_non_alphanumeric': 0.08595453129866085, 'fraction_numerical': 0.002491435689816257, 'mean_word_length': 4.02660406885759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '928258', 'n_tokens_mistral': 864, 'n_tokens_neox': 814, 'n_words': 430}