Version: v0.0.0-...-3606fc6 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2017 License: MIT Imports: 3 Imported by: 2




This section is empty.


This section is empty.


func StartBroker

func StartBroker(du string, ru string) error

Create a new queue. Port Uri to Bind to. Dealer Uri listens to all the master instances. Router Uri listens to all the slave instances.


type Connection

type Connection struct {
	Ctx  *zmq.Context
	Sock *zmq.Socket

func NewConnection

func NewConnection() (*Connection, error)

Push pushes and element onto the queue

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) Connect

func (c *Connection) Connect(uri string, sockType zmq.Type) (err error)

type Process

type Process interface {
	GetResponse(string) string

type ReqConn

type ReqConn struct {
	Conn *Connection

Abstraction of the zmq request.

func NewReqConn

func NewReqConn(uri string) (*ReqConn, error)

func (*ReqConn) Close

func (r *ReqConn) Close()

func (*ReqConn) MakeReq

func (r *ReqConn) MakeReq(msg string) (string, error)

This is the client for the request. Like a web client, a Send is always followed by a recieve.

type RespConn

type RespConn struct {
	Conn *Connection

func NewRespConn

func NewRespConn(uri string) (*RespConn, error)

func (*RespConn) Close

func (r *RespConn) Close()

func (*RespConn) Listen

func (r *RespConn) Listen(process Process, id int) error

Call this function from a goroutine

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL