RosettaCodeData/Task/Rendezvous/Oz/rendezvous-2.oz
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

21 lines
446 B
Text

fun {NewActiveSync Class Init}
Obj = {New Class Init}
MsgPort
in
thread MsgStream in
{NewPort ?MsgStream ?MsgPort}
for Msg#Sync in MsgStream do
try
{Obj Msg}
Sync = unit
catch E then
Sync = {Value.failed E}
end
end
end
proc {$ Msg}
Sync = {Port.sendRecv MsgPort Msg}
in
{Wait Sync}
end
end