| << Prev | - Up - | Next >> |
The functional procedure RunAgenda inputs a description of an agenda, and starts an instance of the concurrent agenda model parametrized by this description.
fun{RunAgenda agenda(initialize:Initialize
processInfo:ProcessInfo)}
<Board>
<StartWatcher>
<FilterInfos>
in
{StartWatcher Board}
{Initialize Board}
{Board.post initialized}
{FilterInfos Board.items}
end First, a record Board is created which provides access to a stream of items, allows to post new items and to start new agents connected to the board. All agents created process information the items on the board concurrently, according to the procedure ProcessInfo. Second, the board is initialized with agents and items according to the procedure Initialize. Third, the main thread calls the procedure FilterInfos which computes the list of all information items on the board incrementally, and terminates once the control item stop is posted to the board.
fun{FilterInfos Items}
case Items
of info(Info)|Is then Info|{FilterInfos Is}
elseof stop|_ then nil
elseof _|Is then {FilterInfos Is}
end
end
| << Prev | - Up - | Next >> |