tdlib-0.3.0: complete binding to the Telegram Database Library
Safe HaskellNone
LanguageHaskell2010

TDLib.EventLoop

Description

A heavyweight TDLib effect intepreter written using event loop

Synopsis

effect interpreter

runTDLibEventLoop :: Members '[Embed IO] r => Double -> (Update -> IO ()) -> Sem (TDLib ': r) a -> Sem r a Source #

runs the TDLib effect

low level functions

type Locks = TVar (IntMap ()) Source #

runCommand :: (ToJSON cmd, FromJSON res) => Client -> Int -> Locks -> Ans -> cmd -> IO res Source #

runs a command and waits for its answer

loop :: Client -> Double -> Locks -> Ans -> (Update -> IO ()) -> IO a Source #

runs the event loop that receives updates from the client and dispatches them