rec_msg
BAP Online Manuals : Library
Reference : Library by Name
: rec_msg
Previous: readln
Next:
BAP Online Manuals : Library Reference : Library by Name : rec_msg
Previous: readln
Next:
Previous: readln
Next:
6.2.105. rec_msg
waits for a message to arrive and retracts it from the mail box
SYNOPSIS
INCLUDE 'msglib.h' rec_msg(SenderID,done)
SYNTAX
rec_msg(SenderID,Term) (i)
ARGUMENTS
server(ServerID) (x) ID of the message sender
char(Term) (x) content of message
DESCRIPTION
Receives messages from other process. Rec_msg() suspends until a message that matches the arguments has arrived. It then returns this message. Upon backtracking it fails.
EXAMPLE
get_my_id(MyID), exec(Server,( something(Results), send_msg(MyID,Results))), something_else, rec_msg(Server,Answer).
ERRORS
No runtime errors.
LAYERS
prolog-process, client-server, object
RELATED PREDICATES
BAP Online Manuals : Library Reference : Library by Name : rec_msg
Previous: readln
Next: