The board can be realized as an instance of the mail box model where all agents connected to the board read all mails send. The variable Board
is bound to a record with three features items, post, startAgent
. The feature items
gives access to the stream of all items on the board. The features post
and code proglang=oz/startAgent/ provide the expected facilities.
- <Board>=
local
Items
local
MailBox={Port.new Items}
in
proc {Post Item}
{Port.send MailBox Item}
end
end
<StartAgent>
in
Board = board(items:Items
post:Post
startAgent:StartAgent)
end