mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-24 17:25:42 +00:00
core: test async handshake (#569)
* core: test async handshake * Update tests/ChatTests.hs Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5fc1364fd3
commit
cd2eb9c88e
@@ -146,6 +146,11 @@ startChatController user = do
|
||||
atomically . writeTVar s $ Just a
|
||||
pure a
|
||||
|
||||
stopChatController :: MonadUnliftIO m => ChatController -> m ()
|
||||
stopChatController ChatController {smpAgent, agentAsync = s} = do
|
||||
disconnectAgentClient smpAgent
|
||||
readTVarIO s >>= mapM_ uninterruptibleCancel >> atomically (writeTVar s Nothing)
|
||||
|
||||
withLock :: MonadUnliftIO m => TMVar () -> m a -> m a
|
||||
withLock lock =
|
||||
E.bracket_
|
||||
|
||||
Reference in New Issue
Block a user