@@ -534,8 +534,8 @@ mxAgentWithFinalize mxId initState handlers dtor = do
534 , matchSTM (readTChan chan) return]
534 , matchSTM (readTChan chan) return]
535 InputChan -> [ matchSTM (readTChan chan) return
535 InputChan -> [ matchSTM (readTChan chan) return
536 , matchAny return]
536 , matchAny return]
537− in getNextInput' matches 0
537+ in receiveWait matches
539 getNextInput' ms n = do
539 getNextInput' ms n = do
540 mIn <- receiveTimeout n ms
540 mIn <- receiveTimeout n ms
541 case mIn of
541 case mIn of
@@ -545,7 +545,7 @@ mxAgentWithFinalize mxId initState handlers dtor = do
545 tryNextInput ms n
545 tryNextInput ms n
546 | n > 0 && n < 2000 = getNextInput' ms $ n * 2
546 | n > 0 && n < 2000 = getNextInput' ms $ n * 2
547 | otherwise = getNextInput' ms 100
547 | otherwise = getNextInput' ms 100
549 runAgentFinalizer :: MxAgent s () -> MxAgentState s -> Process ()
549 runAgentFinalizer :: MxAgent s () -> MxAgentState s -> Process ()
550 runAgentFinalizer f s = ST.runStateT (unAgent f) s >>= return . fst
550 runAgentFinalizer f s = ST.runStateT (unAgent f) s >>= return . fst