wip. fixing TCP busyloop

This commit is contained in:
voidlizard 2025-03-15 07:44:43 +03:00
parent fd8cafc9fc
commit 025b269562
1 changed files with 5 additions and 5 deletions

View File

@ -391,11 +391,11 @@ runMessagingTCP env@MessagingTCP{..} = liftIO do
forever $ void $ runMaybeT do
-- client sockets
-- смотрим к кому надо
who <- atomically $ fix \next -> do
who <- readTQueue _tcpConnDemand
already <- readTVar _tcpPeerConn <&> HM.member who
if not already then pure who else next
who <- atomically $ readTQueue _tcpConnDemand
already <- readTVarIO _tcpPeerConn <&> HM.member who
when already mzero
debug $ "DEMAND:" <+> pretty who