Documentation ¶
Overview ¶
Majordomo Protocol Client and Worker API. Implements the MDP/Worker spec at http://rfc.zeromq.org/spec:7.
Index ¶
- Constants
- Variables
- type Mdcli
- type Mdcli2
- type Mdwrk
- func (mdwrk *Mdwrk) Close()
- func (mdwrk *Mdwrk) ConnectToBroker() (err error)
- func (mdwrk *Mdwrk) Recv(reply []string) (msg []string, err error)
- func (mdwrk *Mdwrk) SendToBroker(command string, option string, msg []string) (err error)
- func (mdwrk *Mdwrk) SetHeartbeat(heartbeat time.Duration)
- func (mdwrk *Mdwrk) SetReconnect(reconnect time.Duration)
Constants ¶
const ( // This is the version of MDP/Client we implement MDPC_CLIENT = "MDPC01" // This is the version of MDP/Worker we implement MDPW_WORKER = "MDPW01" )
const ( // MDP/Server commands, as strings MDPW_READY = string(iota + 1) MDPW_REQUEST MDPW_REPLY MDPW_HEARTBEAT MDPW_DISCONNECT )
Variables ¶
var ( MDPS_COMMANDS = map[string]string{ MDPW_READY: "READY", MDPW_REQUEST: "REQUEST", MDPW_REPLY: "REPLY", MDPW_HEARTBEAT: "HEARTBEAT", MDPW_DISCONNECT: "DISCONNECT", } )
Functions ¶
This section is empty.
Types ¶
type Mdcli ¶
type Mdcli struct {
// contains filtered or unexported fields
}
Majordomo Protocol Client API.
func (*Mdcli) ConnectToBroker ¶
Connect or reconnect to broker.
func (*Mdcli) Send ¶
Here is the send method. It sends a request to the broker and gets a reply even if it has to retry several times. It returns the reply message, or error if there was no reply after multiple attempts:
func (*Mdcli) SetTimeout ¶
Set request timeout.
type Mdcli2 ¶
type Mdcli2 struct {
// contains filtered or unexported fields
}
Majordomo Protocol Client API.
func (*Mdcli2) ConnectToBroker ¶
Connect or reconnect to broker. In this asynchronous class we use a DEALER socket instead of a REQ socket; this lets us send any number of requests without waiting for a reply.
func (*Mdcli2) Send ¶
The send method now just sends one message, without waiting for a reply. Since we're using a DEALER socket we have to send an empty frame at the start, to create the same envelope that the REQ socket would normally make for us:
func (*Mdcli2) SetTimeout ¶
Set request timeout.
type Mdwrk ¶
type Mdwrk struct {
// contains filtered or unexported fields
}
Majordomo Protocol Worker API.
func (*Mdwrk) ConnectToBroker ¶
Connect or reconnect to broker.
func (*Mdwrk) SendToBroker ¶
Send message to broker.
func (*Mdwrk) SetHeartbeat ¶
Set heartbeat delay.
func (*Mdwrk) SetReconnect ¶
Set reconnect delay.