@@ -49,6 +49,20 @@
49-- http://www.erlang.org/faq/academic.html
49-- http://www.erlang.org/faq/academic.html
50-- [4] "Delivery of Messages", post on erlang-questions
50-- [4] "Delivery of Messages", post on erlang-questions
51-- http://erlang.org/pipermail/erlang-questions/2012-February/064767.html
51-- http://erlang.org/pipermail/erlang-questions/2012-February/064767.html
55+-- 1. Central MonitorAction mapping, so that we can efficiently execute monitor
56+-- actions from Network.Transport.receive-ing thread.
57+-- 2. Access this mapping from send too, because we cannot rely on
58+-- EventConnectionLost (although it so happens that with the TCP transport
60+-- 3. Modify EvenConnectionLost to have Maybe EndPointAddress
61+-- 4. Change in API? (you can register multiple monitors, they get MonitorIds.
62+-- to unregister, to provide the monitor ID -- if we do, unregistering the
63+-- same ID multiple times is idempotent)
64+-- 5. You get precisely one notification per monitor
65+-- 6. When a connection is already broken, monitor notifies immediately
52module Control.Distributed.Process
66module Control.Distributed.Process
53 ( -- * Basic cloud Haskell API
67 ( -- * Basic cloud Haskell API
@@ -490,14 +504,8 @@ sendBinary them conn payload = do
490 result <- liftIO $ NT.send conn payload
504 result <- liftIO $ NT.send conn payload
491 case result of
505 case result of
492 Right () -> return ()
506 Right () -> return ()
495− -- TODO: put into unreachable state rather than Nothing
496− -- ourState <- processState <$> ask
497− liftIO $ modifyMVar_ ourState $
498− return . (connectionTo them ^= Nothing)
500− remoteProcessFailed them
507+ Left _ -> remoteProcessFailed them
502sendMessage :: ProcessId -> NT.Connection -> Message -> Process ()
510sendMessage :: ProcessId -> NT.Connection -> Message -> Process ()
503sendMessage them conn (Message fp enc) =
511sendMessage them conn (Message fp enc) =