Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype ServerState = ServerState {}
- type ConnectionID = Int
- serverState :: ServerState
- addConnection :: Connection -> ServerState -> (ServerState, ConnectionID)
- deleteConnection :: ConnectionID -> ServerState -> ServerState
- theStore :: Store (MVar ServerState)
- send :: ToJSON a => a -> IO ()
- startConfig :: Config -> IO ()
- application :: Config -> ServerApp
- closeConnection :: Config -> ConnectionID -> ConnectionException -> IO ()
Documentation
newtype ServerState Source #
type ConnectionID = Int Source #
addConnection :: Connection -> ServerState -> (ServerState, ConnectionID) Source #
send :: ToJSON a => a -> IO () Source #
Send a JSON object to all clients. Throws an exception if initialise
has
not been run first.
startConfig :: Config -> IO () Source #
Start the websocket server using the port specified in the config. Call once per GHCi session.
application :: Config -> ServerApp Source #
closeConnection :: Config -> ConnectionID -> ConnectionException -> IO () Source #