[ library(notify_ports) | Reference Manual | Alphabetic Index ]
open_receiver_init(+SendPos, +SendStruct, +InitialMessages, -InitialMessagesTail, +ReceivePos, +ReceiveStruct)
Create a receiver for a given notification sender
- SendPos
- positive integer, the send port's field number in SendStruct
- SendStruct
- a structure whose SendPos-th field is a send port
- InitialMessages
- the head of a list of initial messages
- InitialMessagesTail
- the tail of the list of initial messages
- ReceivePos
- positive integer, the send port's field number in ReceiveStruct
- ReceiveStruct
- a structure with free field ReceivePos
Description
SendPos and SendStruct identify a send port. This predicate
creates a receive port listening to messages sent via the
specified send port. The new receive port will receive all
messages that are sent via the send port after the receiver has
been opened. Messages that were sent before the receiver has been
opened will not be received by this receiver.
The receiver will be installed in field ReceivePos of the structure
ReceiveStruct.
In addition to open_receiver/4, there is a difference list pair
(InitialMessages and InitialMessagesTail) which can be used to
fake a sequence of initial message that will be received on
the receive port without actually having been sent from the
associated send port. This feature can be used to bring the
message receiving agent into a particular starting state.
See Also
open_receiver / 4