Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- handle_request(RPID,Tuple,Pattern,Mode)
- recieve % main listener loop
- {RPID, _, Pattern,"take"} -> % someone wants tuple matching pattern
- recieve % Single loop through stored messages:
- {_, Tuple, _ , "put"} -> % look for tuples sent with "put"
- case match (Tuple, Pattern) of
- true ->
- RPID ! Tuple; % yay, simple return.
- false ->
- % Well, RPID should block here.. dunno how.
- after
- 0 ->
- end; % end "take" recieve pattern
- end.
Add Comment
Please, Sign In to add comment