@@ -122,7 +122,7 @@ import Control.Distributed.Process.Internal.Messaging
122122 ( sendBinary
123123 , sendMessage
124124 , sendPayload
125− , reconnect
125+ , ImplicitReconnect(WithImplicitReconnect, NoImplicitReconnect)
126126 )
127127import Control.Distributed.Process.Internal.Primitives (expect, register, finally)
128128import qualified Control.Distributed.Process.Internal.Closure.BuiltIn as BuiltIn (remoteTable)
@@ -422,6 +422,7 @@ nodeController = do
422422 liftIO $ sendBinary node
423423 (ctrlMsgSender msg)
424424 (NodeIdentifier nid')
425+ WithImplicitReconnect
425426 msg
426427 _ ->
427428 return ()
@@ -445,8 +446,6 @@ nodeController = do
445446 ncEffectWhereIs from label
446447 NCMsg from (NamedSend label msg') ->
447448 ncEffectNamedSend from label msg'
448− NCMsg from (Reconnect to) ->
449− ncEffectReconnect from to
450449 unexpected ->
451450 error $ "nodeController: unexpected message " ++ show unexpected
452451
@@ -475,6 +474,7 @@ ncEffectMonitor from them mRef = do
475474 liftIO $ sendBinary node
476475 (NodeIdentifier $ localNodeId node)
477476 (NodeIdentifier $ processNodeId from)
477+ WithImplicitReconnect
478478 NCMsg
479479 { ctrlMsgSender = NodeIdentifier (localNodeId node)
480480 , ctrlMsgSignal = Died them DiedUnknownId
@@ -537,6 +537,7 @@ ncEffectSpawn pid cProc ref = do
537537 liftIO $ sendMessage node
538538 (NodeIdentifier (localNodeId node))
539539 (ProcessIdentifier pid)
540+ WithImplicitReconnect
540541 (DidSpawn ref pid')
541542
542543-- Unified semantics does not explicitly describe how to implement 'register',
@@ -556,6 +557,7 @@ ncEffectWhereIs from label = do
556557 liftIO $ sendMessage node
557558 (NodeIdentifier (localNodeId node))
558559 (ProcessIdentifier from)
560+ WithImplicitReconnect
559561 (WhereIsReply label mPid)
560562
561563-- [Unified: Table 14]
@@ -568,14 +570,9 @@ ncEffectNamedSend from label msg = do
568570 liftIO $ sendPayload node
569571 from
570572 (ProcessIdentifier pid)
573+ NoImplicitReconnect
571574 (messageToPayload msg)
572575
573−-- Reconnecting
574−ncEffectReconnect :: Identifier -> Identifier -> NC ()
575−ncEffectReconnect from to = do
576− node <- ask
577− liftIO $ reconnect node from to
578−
579576--------------------------------------------------------------------------------
580577-- Auxiliary --
581578--------------------------------------------------------------------------------
@@ -601,11 +598,11 @@ notifyDied dest src reason mRef = do
601598 (True, Nothing, SendPortIdentifier pid) ->
602599 throwException dest $ PortLinkException pid reason
603600 (False, _, _) ->
604− -- TODO: why the change in sender? How does that affect 'reconnect' semantics?
605− -- (see [Unified: Table 10]
601+ -- The change in sender comes from [Unified: Table 10]
606602 liftIO $ sendBinary node
607603 (NodeIdentifier $ localNodeId node)
608604 (NodeIdentifier $ processNodeId dest)
605+ WithImplicitReconnect
609606 NCMsg
610607 { ctrlMsgSender = NodeIdentifier (localNodeId node)
611608 , ctrlMsgSignal = Died src reason
@@ -621,7 +618,6 @@ destNid (Spawn _ _) = Nothing
621618destNid (Register _ _) = Nothing
622619destNid (WhereIs _) = Nothing
623620destNid (NamedSend _ _) = Nothing
624−destNid (Reconnect _) = Nothing
625621-- We don't need to forward 'Died' signals; if monitoring/linking is setup,
626622-- then when a local process dies the monitoring/linking machinery will take
627623-- care of notifying remote nodes
@@ -721,10 +717,12 @@ registryFor ident = registry >>> DAC.mapMaybe ident
721717--
722718-- * the notifications for that process specifically and
723719-- * the notifications for typed channels to that process.
720+--
721+-- See https://github.com/haskell/containers/issues/14 for the bang on _v.
724722splitNotif :: Identifier
725723 -> Map Identifier a
726724 -> (Map Identifier a, Map Identifier a)
727−splitNotif ident = Map.partitionWithKey (\k !v -> impliesDeathOf ident k)
725+splitNotif ident = Map.partitionWithKey (\k !_v -> impliesDeathOf ident k)
728726
729727-- | Does the death of one entity (node, project, channel) imply the death
730728-- of another?