gozmq

package module
v0.0.0-...-0daa84a Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2016 License: MIT Imports: 4 Imported by: 6

README

gozmq

GoZMQ is a pure Go ZMQ pubsub client implementation.

Only a very limited subset of ZMQ is implemented: NULL security, SUB socket.

Usage

Please visit https://godoc.org/github.com/tstranex/gozmq for the full documentation.

Installation

To install, run:

go get github.com/tstranex/gozmq

Example

See example/main.go for a full example.

c, err := gozmq.Subscribe("127.0.0.1:1234", []string{""})
for {
  msg, err := c.Receive()
  // Process message
}

Documentation

Overview

Package gozmq provides a ZMQ pubsub client.

It implements the protocol described here: http://rfc.zeromq.org/spec:23/ZMTP/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is a connection to a ZMQ server.

func Subscribe

func Subscribe(addr string, topics []string) (*Conn, error)

Subscribe connects to a publisher server and subscribes to the given topics.

func (*Conn) Close

func (c *Conn) Close() error

Close the underlying connection. Any further operations will fail.

func (*Conn) Receive

func (c *Conn) Receive() ([][]byte, error)

Receive a message from the publisher. It blocks until a new message is received.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL