Documentation ¶
Overview ¶
Majordomo Protocol Client API. Implements the MDP/Worker spec at http://rfc.zeromq.org/spec:7.
Majordomo Protocol Client and Worker API. Implements the MDP/Worker spec at http://rfc.zeromq.org/spec:7.
Majordomo Protocol Worker API. Implements the MDP/Worker spec at http://rfc.zeromq.org/spec:7.
Index ¶
- Constants
- Variables
- type Broker
- func (b *Broker) Bind(endpoint string) (err error)
- func (b *Broker) ClientMsg(sender string, msg []string)
- func (b *Broker) Close() (err error)
- func (b *Broker) Purge()
- func (b *Broker) Run(done chan bool)
- func (b *Broker) ServiceRequire(service_frame string) (service *Service)
- func (b *Broker) WorkerMsg(sender string, msg []string)
- type Client
- type Service
- type Worker
- func (w *Worker) Close()
- func (w *Worker) ConnectToBroker() (err error)
- func (w *Worker) Recv(reply []string) (msg []string, err error)
- func (w *Worker) SendToBroker(command string, option string, msg []string) (err error)
- func (w *Worker) SetHeartbeat(heartbeat time.Duration)
- func (w *Worker) SetReconnect(reconnect time.Duration)
Constants ¶
View Source
const ( HEARTBEAT_LIVENESS = 3 // 3-5 is reasonable HEARTBEAT_INTERVAL = 2500 * time.Millisecond // msecs HEARTBEAT_EXPIRY = HEARTBEAT_INTERVAL * HEARTBEAT_LIVENESS )
TODO: get these from config data
View Source
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" )
View Source
const ( // MDP/Server commands, as strings MDPW_READY = string(iota + 1) MDPW_REQUEST MDPW_REPLY MDPW_HEARTBEAT MDPW_DISCONNECT )
Variables ¶
View Source
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 Broker ¶ added in v0.1.20
type Broker struct { Socket *zmq.Socket // Socket for clients & workers Waiting []*brokerWorker // List of waiting workers HeartbeatAt time.Time // When to send HEARTBEAT // contains filtered or unexported fields }
func (*Broker) ServiceRequire ¶ added in v0.1.20
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Majordomo Protocol Client API.
func (*Client) 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.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Majordomo Protocol Worker API.
func (*Worker) ConnectToBroker ¶
Connect or reconnect to broker.
func (*Worker) SendToBroker ¶
Send message to broker.
func (*Worker) SetHeartbeat ¶
Set heartbeat delay.
func (*Worker) SetReconnect ¶
Set reconnect delay.
Click to show internal directories.
Click to hide internal directories.