-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell API for NATS messaging system -- @package nats-queue @version 0.1.1.0 module Network.Nats -- | Control structure representing a connection to NATS server data Nats data NatsSID -- | Connect to a NATS server connect :: String -> IO Nats -- | NATS communication error data NatsException type MsgCallback = NatsSID -> String -> ByteString -> Maybe String -> IO () -- | Subscribe to a channel, optionally specifying queue group subscribe :: Nats -> String -> (Maybe String) -> MsgCallback -> IO NatsSID -- | Unsubscribe from a channel unsubscribe :: Nats -> NatsSID -> IO () -- | Publish a message publish :: Nats -> String -> ByteString -> IO () -- | Synchronous request/response communication request :: Nats -> String -> ByteString -> IO ByteString -- | Disconnect from a NATS server disconnect :: Nats -> IO () instance Num NatsSID instance Ord NatsSID instance Eq NatsSID instance Show NatsSvrMessage instance Show Subject instance Read NatsSID instance Show NatsSID instance FromJSON NatsServerInfo instance ToJSON NatsServerInfo instance Show NatsServerInfo instance FromJSON NatsConnectionOptions instance ToJSON NatsConnectionOptions instance Typeable NatsException instance Show NatsException instance Show NatsConnectionOptions instance Exception NatsException module Network.Nats.Json -- | Subscribe to a channel, optionally specifying queue group If the JSON -- cannot be properly parsed, the message is ignored subscribe :: FromJSON a => Nats -> String -> (Maybe String) -> (NatsSID -> String -> a -> Maybe String -> IO ()) -> IO NatsSID -- | Publish a message publish :: ToJSON a => Nats -> String -> a -> IO ()