| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Discord.Internal.Gateway.EventLoop
Description
Provides logic code for interacting with the Discord websocket gateway. Realistically, this is probably lower level than most people will need
Synopsis
- data GatewayHandle = GatewayHandle {}
- data GatewayException
- data LoopState
- data SendablesData = SendablesData {}
- connectionLoop :: Auth -> GatewayIntent -> GatewayHandle -> Chan Text -> IO ()
- runEventLoop :: GatewayHandle -> SendablesData -> Chan Text -> IO LoopState
- heartbeat :: SendablesData -> IORef Integer -> IO ()
- getPayloadTimeout :: SendablesData -> Chan Text -> IO (Either ConnectionException GatewayReceivable)
- getPayload :: Connection -> Chan Text -> IO (Either ConnectionException GatewayReceivable)
- sendableLoop :: Connection -> GatewayHandle -> SendablesData -> Chan Text -> IO ()
Documentation
data GatewayHandle Source #
data GatewayException Source #
Constructors
| GatewayExceptionCouldNotConnect Text | |
| GatewayExceptionEventParseError Text Text | |
| GatewayExceptionUnexpected GatewayReceivable Text | |
| GatewayExceptionConnection ConnectionException Text | 
Instances
| Show GatewayException Source # | |
| Defined in Discord.Internal.Gateway.EventLoop Methods showsPrec :: Int -> GatewayException -> ShowS # show :: GatewayException -> String # showList :: [GatewayException] -> ShowS # | |
State of the eventloop
Constructors
| LoopStart | |
| LoopClosed | |
| LoopReconnect | 
data SendablesData Source #
Enough info for library to send info to discord.
Constructors
| SendablesData | |
connectionLoop :: Auth -> GatewayIntent -> GatewayHandle -> Chan Text -> IO () Source #
runEventLoop :: GatewayHandle -> SendablesData -> Chan Text -> IO LoopState Source #
getPayloadTimeout :: SendablesData -> Chan Text -> IO (Either ConnectionException GatewayReceivable) Source #
getPayload :: Connection -> Chan Text -> IO (Either ConnectionException GatewayReceivable) Source #
sendableLoop :: Connection -> GatewayHandle -> SendablesData -> Chan Text -> IO () Source #