Safe Haskell | None |
---|---|
Language | Haskell2010 |
PostgresWebsockets
Contents
Description
PostgresWebsockets Middleware, composing this allows postgrest to create websockets connections that will communicate with the database through LISTEN/NOTIFY channels.
Synopsis
- postgresWsMiddleware :: ByteString -> ByteString -> Pool -> Multiplexer -> Application -> Application
- newHasqlBroadcaster :: ByteString -> ByteString -> IO Multiplexer
- newHasqlBroadcasterOrError :: ByteString -> ByteString -> IO (Either ByteString Multiplexer)
Documentation
postgresWsMiddleware :: ByteString -> ByteString -> Pool -> Multiplexer -> Application -> Application Source #
Given a secret, a function to fetch the system time, a Hasql Pool and a Multiplexer this will give you a WAI middleware.
Re-exports
newHasqlBroadcaster :: ByteString -> ByteString -> IO Multiplexer Source #
Returns a multiplexer from a connection URI, keeps trying to connect in case there is any error. This function also spawns a thread that keeps relaying the messages from the database to the multiplexer's listeners
newHasqlBroadcasterOrError :: ByteString -> ByteString -> IO (Either ByteString Multiplexer) Source #
Returns a multiplexer from a connection URI or an error message on the left case This function also spawns a thread that keeps relaying the messages from the database to the multiplexer's listeners