postgres-websockets-0.4.2.1: Middleware to map LISTEN/NOTIFY messages to Websockets

Safe HaskellNone
LanguageHaskell2010

PostgresWebsockets

Contents

Description

PostgresWebsockets Middleware, composing this allows postgrest to create websockets connections that will communicate with the database through LISTEN/NOTIFY channels.

Synopsis

Documentation

postgresWsMiddleware :: Maybe 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 -> 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 -> 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