mirror of https://github.com/voidlizard/hbs2
wip, busyloop removed? maybe leak
This commit is contained in:
parent
025b269562
commit
b7e5fcdbe3
|
@ -9,6 +9,8 @@ constraints:
|
||||||
, suckless-conf >= 0.1.2.7
|
, suckless-conf >= 0.1.2.7
|
||||||
, http-client >=0.7.16 && <0.8
|
, http-client >=0.7.16 && <0.8
|
||||||
|
|
||||||
|
|
||||||
|
debug-info: True
|
||||||
-- executable-static: True
|
-- executable-static: True
|
||||||
-- profiling: True
|
-- profiling: True
|
||||||
--library-profiling: False
|
--library-profiling: False
|
||||||
|
|
|
@ -243,20 +243,20 @@ runMessagingTCP env@MessagingTCP{..} = liftIO do
|
||||||
S.yield =<< ( readTVarIO _tcpSent <&> ("tcpSent",) . fromIntegral . HM.size)
|
S.yield =<< ( readTVarIO _tcpSent <&> ("tcpSent",) . fromIntegral . HM.size)
|
||||||
|
|
||||||
sweepCookies <- ContT $ withAsync $ forever do
|
sweepCookies <- ContT $ withAsync $ forever do
|
||||||
pause @'Seconds 10
|
pause @'Seconds 120
|
||||||
atomically do
|
-- atomically do
|
||||||
pips <- readTVar _tcpPeerConn
|
-- pips <- readTVar _tcpPeerConn
|
||||||
modifyTVar _tcpPeerToCookie (HM.filterWithKey (\k _ -> HM.member k pips))
|
-- modifyTVar _tcpPeerToCookie (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||||
alive <- readTVar _tcpPeerToCookie <&> HS.fromList . HM.elems
|
-- alive <- readTVar _tcpPeerToCookie <&> HS.fromList . HM.elems
|
||||||
modifyTVar _tcpPeerCookie (HM.filterWithKey (\k _ -> HS.member k alive))
|
-- modifyTVar _tcpPeerCookie (HM.filterWithKey (\k _ -> HS.member k alive))
|
||||||
|
|
||||||
sweep <- ContT $ withAsync $ forever do
|
sweep <- ContT $ withAsync $ forever do
|
||||||
pause @'Seconds 60
|
pause @'Seconds 120
|
||||||
atomically do
|
-- atomically do
|
||||||
pips <- readTVar _tcpPeerConn
|
-- pips <- readTVar _tcpPeerConn
|
||||||
modifyTVar _tcpSent (HM.filterWithKey (\k _ -> HM.member k pips))
|
-- modifyTVar _tcpSent (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||||
modifyTVar _tcpPeerSocket (HM.filterWithKey (\k _ -> HM.member k pips))
|
-- modifyTVar _tcpPeerSocket (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||||
modifyTVar _tcpPeerCookie (HM.filter (>=1))
|
-- modifyTVar _tcpPeerCookie (HM.filter (>=1))
|
||||||
|
|
||||||
waitAnyCatchCancel [p1,p2,probes,sweep,sweepCookies]
|
waitAnyCatchCancel [p1,p2,probes,sweep,sweepCookies]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue