git.iko.soy/distributed-process
on master help sign in
cosmetic (whitespace)
f457c12Tim Watson
distributed-process/src/Control/Distributed/Process/Node.hs+10−10
@@ -748,7 +748,7 @@ ncEffectExit from to reason = do
748-- [Issue #89]
748-- [Issue #89]
749ncEffectGetInfo :: ProcessId -> ProcessId -> NC ()
749ncEffectGetInfo :: ProcessId -> ProcessId -> NC ()
750ncEffectGetInfo from pid =
750ncEffectGetInfo from pid =
751− let lpid = processLocalId pid
751+ let lpid = processLocalId pid
752 them = (ProcessIdentifier pid)
752 them = (ProcessIdentifier pid)
753 in do
753 in do
754 node <- ask
754 node <- ask
@@ -761,8 +761,8 @@ ncEffectGetInfo from pid =
761 registered <- gets (^. registeredHere)
761 registered <- gets (^. registeredHere)
762 sendInfo pid
762 sendInfo pid
763 (isLocal node (ProcessIdentifier from))
763 (isLocal node (ProcessIdentifier from))
764− proc node itsLinks itsMons (registeredNames registered)
764+ proc node itsLinks itsMons (registeredNames registered)
765−
765+
766 where sendInfo :: ProcessId
766 where sendInfo :: ProcessId
767 -> Bool
767 -> Bool
768 -> LocalProcess
768 -> LocalProcess
@@ -773,14 +773,14 @@ ncEffectGetInfo from pid =
773 -> NC ()
773 -> NC ()
774 sendInfo d lc lp n l m r = do
774 sendInfo d lc lp n l m r = do
775 qLen <- qLength lp
775 qLen <- qLength lp
776− dispatch lc d n ProcessInfo {
776+ dispatch lc d n ProcessInfo {
777 infoNode = localNodeId n
777 infoNode = localNodeId n
778 , infoRegisteredNames = r
778 , infoRegisteredNames = r
779 , infoMessageQueueLength = qLen
779 , infoMessageQueueLength = qLen
780 , infoMonitors = m
780 , infoMonitors = m
781− , infoLinks = l
781+ , infoLinks = l
782 }
782 }
783−
783+
784 dispatch :: Bool
784 dispatch :: Bool
785 -> ProcessId
785 -> ProcessId
786 -> LocalNode
786 -> LocalNode
@@ -793,16 +793,16 @@ ncEffectGetInfo from pid =
793 (ProcessIdentifier dest)
793 (ProcessIdentifier dest)
794 WithImplicitReconnect
794 WithImplicitReconnect
795 pInfo
795 pInfo
796−
796+
797 -- TODO: make this available to other functions?
797 -- TODO: make this available to other functions?
798 qLength :: LocalProcess -> NC (Maybe Int)
798 qLength :: LocalProcess -> NC (Maybe Int)
799 qLength lp = do
799 qLength lp = do
800− qRef <- liftIO $ deRefWeak (processWeakQ lp)
800+ qRef <- liftIO $ deRefWeak (processWeakQ lp)
801 case qRef of
801 case qRef of
802 Nothing -> return $ Nothing
802 Nothing -> return $ Nothing
803 Just qr -> liftIO $ Mailbox.length qr >>= return . Just
803 Just qr -> liftIO $ Mailbox.length qr >>= return . Just
804−
804+
805− registeredNames = Map.foldlWithKey (\ks k v -> if v == pid
805+ registeredNames = Map.foldlWithKey (\ks k v -> if v == pid
806 then (k:ks)
806 then (k:ks)
807 else ks) []
807 else ks) []
808
808