

:- [ixwrap,newutil]. 
:- ['address.db']. 

run1 :-
   exec(_, post_issue(issue_occ(test1, test2))). 

run2 :-
   exec(_, receive_issue(issue_occ(Sender, Msg))), 
   write(Sender),nl,nl,
   write(Msg),nl,nl. 
   

%%%%%%%%%%%% post issue %%%%%%%%%%

exec(_, post_issue(issue_occ(X, Y))) :- 

   to_port(aberdeen, Port), 
   ix_send(9876, Port, issue_occ(X, Y)). 

%%%%%%%%%%%% receive issue %%%%%%%%%%

exec(_, receive_issue(issue_occ(Sender, Message))) :-

   wfe_read_message(Sender, Message), 
   write(Sender),nl,
   write(Message). 
