Copyright | (c) Lars Petersen 2016 |
---|---|
License | MIT |
Maintainer | info@lars-petersen.net |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- data Broker auth
- newBroker :: auth -> IO (Broker auth)
- publishUpstream :: Broker auth -> Message -> IO ()
- publishDownstream :: Broker auth -> Message -> IO ()
- withSession :: forall auth. Authenticator auth => Broker auth -> ConnectionRequest -> (RejectReason -> IO ()) -> (Session auth -> SessionPresent -> IO ()) -> IO ()
- getUptime :: Broker auth -> IO Int64
- getSessions :: Broker auth -> IO (IntMap (Session auth))
- getSubscriptions :: Broker auth -> IO (Trie IntSet)
- lookupSession :: SessionIdentifier -> Broker auth -> IO (Maybe (Session auth))
Documentation
publishUpstream :: Broker auth -> Message -> IO () Source #
Publish a message upstream on the broker.
- As long as the broker is not clustered upstream=downstream.
- FUTURE NOTE: In clustering mode this shall distribute the message to other brokers or upwards when the brokers form a hierarchy.
publishDownstream :: Broker auth -> Message -> IO () Source #
Inject a message downstream into the broker. It will be delivered to all subscribed sessions within this broker instance.
withSession :: forall auth. Authenticator auth => Broker auth -> ConnectionRequest -> (RejectReason -> IO ()) -> (Session auth -> SessionPresent -> IO ()) -> IO () Source #
lookupSession :: SessionIdentifier -> Broker auth -> IO (Maybe (Session auth)) Source #