Safe Haskell | None |
---|---|
Language | Haskell2010 |
PostgRESTWS Middleware, composing this allows postgrest to create websockets connections that will communicate with the database through LISTEN/NOTIFY channels.
- postgrestWsMiddleware :: ByteString -> IO POSIXTime -> Pool -> Multiplexer -> Application -> Application
- newHasqlBroadcasterOrError :: ByteString -> IO (Either ByteString Multiplexer)
Documentation
postgrestWsMiddleware :: ByteString -> IO POSIXTime -> 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
newHasqlBroadcasterOrError :: 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