Safe Haskell | None |
---|---|
Language | Haskell2010 |
Client
Contents
Synopsis
- data Client
- newClient :: Handle -> IO Client
- defaultConn :: String -> Int -> IO Handle
- data MsgView = MsgView {
- subject :: ByteString
- sid :: ByteString
- replyTo :: Maybe ByteString
- payload :: Maybe ByteString
- headers :: Maybe [(ByteString, ByteString)]
- publish :: Client -> Subject -> [PubOptions -> PubOptions] -> IO ()
- subscribe :: Client -> Subject -> (MsgView -> IO ()) -> IO SID
- unsubscribe :: Client -> SID -> IO ()
- ping :: Client -> IO () -> IO ()
- pubWithPayload :: Payload -> PubOptions -> PubOptions
- pubWithReplyCallback :: (MsgView -> IO ()) -> PubOptions -> PubOptions
- pubWithHeaders :: Headers -> PubOptions -> PubOptions
Documentation
newClient :: Handle -> IO Client #
newClient creates a new Client
instance and starts the necessary pipelines.
defaultConn :: String -> Int -> IO Handle #
defaultConn is a sane default connection that can be used as an argument to newClient
.
MsgView represents a MSG in the NATS protocol.
Constructors
MsgView | |
Fields
|
publish :: Client -> Subject -> [PubOptions -> PubOptions] -> IO () #
publish sends a message to the NATS server.
subscribe :: Client -> Subject -> (MsgView -> IO ()) -> IO SID #
subscribe is used to subscribe to a subject on the NATS server.
unsubscribe :: Client -> SID -> IO () #
unsubscribe is used to unsubscribe from a subject on the NATS server.
pubWithPayload :: Payload -> PubOptions -> PubOptions #
pubWithPayload is used to set the payload for a publish operation.
pubWithReplyCallback :: (MsgView -> IO ()) -> PubOptions -> PubOptions #
pubWithReplyCallback is used to set a callback for a reply to a publish operation.
pubWithHeaders :: Headers -> PubOptions -> PubOptions #
pubWithHeaders is used to set headers for a publish operation.
Orphan instances
SelfHealer ByteString ParserErr # | |
Methods heal :: ByteString -> ParserErr -> (ByteString, ParserState) |