diff options
Diffstat (limited to 'deps/discord-haskell/src/Discord/Internal/Gateway.hs')
| -rw-r--r-- | deps/discord-haskell/src/Discord/Internal/Gateway.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/deps/discord-haskell/src/Discord/Internal/Gateway.hs b/deps/discord-haskell/src/Discord/Internal/Gateway.hs index f07be39..a31c4de 100644 --- a/deps/discord-haskell/src/Discord/Internal/Gateway.hs +++ b/deps/discord-haskell/src/Discord/Internal/Gateway.hs @@ -7,6 +7,7 @@ module Discord.Internal.Gateway , CacheHandle(..) , GatewayException(..) , Cache(..) + , initializeCache , startCacheThread , startGatewayThread , module Discord.Internal.Types @@ -21,13 +22,13 @@ import Data.Time (getCurrentTime) import Discord.Internal.Types (Auth, EventInternalParse, GatewayIntent) import Discord.Internal.Gateway.EventLoop (connectionLoop, GatewayHandle(..), GatewayException(..)) -import Discord.Internal.Gateway.Cache (cacheLoop, Cache(..), CacheHandle(..)) +import Discord.Internal.Gateway.Cache (cacheLoop, Cache(..), CacheHandle(..), initializeCache) -- | Starts a thread for the cache startCacheThread :: Bool -> Chan T.Text -> IO (CacheHandle, ThreadId) startCacheThread isEnabled log = do events <- newChan :: IO (Chan (Either GatewayException EventInternalParse)) - cache <- newEmptyMVar :: IO (MVar (Either (Cache, GatewayException) Cache)) + cache <- newEmptyMVar :: IO (MVar Cache) let cacheHandle = CacheHandle events cache tid <- forkIO $ cacheLoop isEnabled cacheHandle log pure (cacheHandle, tid) |
