natskell
Safe HaskellNone
LanguageHaskell2010

Client

Synopsis

Documentation

data Client #

Client is used to iteract with the NATS server.

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.

data MsgView #

MsgView represents a MSG in the NATS protocol.

Constructors

MsgView 

Fields

Instances

Instances details
Show MsgView # 
Instance details

Defined in Client

Eq MsgView # 
Instance details

Defined in Client

Methods

(==) :: MsgView -> MsgView -> Bool #

(/=) :: MsgView -> MsgView -> Bool #

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.

ping :: Client -> IO () -> IO () #

ping is used to send a ping message to 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 # 
Instance details

Methods

heal :: ByteString -> ParserErr -> (ByteString, ParserState)