client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DefaultReconnectInterval ...
	DefaultReconnectInterval = 2

	// DefaultMaxReconnectInterval ...
	DefaultMaxReconnectInterval = 64
)

Variables

View Source
var (
	// PublishedRegexp ...
	PublishedRegexp = regexp.MustCompile(
		"message successfully published to \\w+ with sequence \\d",
	)
)

Functions

This section is empty.

Types

type Client

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

Client ...

func NewClient

func NewClient(url string, options *Options) *Client

NewClient ...

func (*Client) Handle

func (c *Client) Handle(msg *msgbus.Message) error

Handle ...

func (*Client) Publish

func (c *Client) Publish(topic, message string) error

Publish ...

func (*Client) Pull

func (c *Client) Pull(topic string) (msg *msgbus.Message, err error)

Pull ...

func (*Client) Subscribe

func (c *Client) Subscribe(topic string, handler msgbus.HandlerFunc) *Subscriber

Subscribe ...

type Options

type Options struct {
	ReconnectInterval    int
	MaxReconnectInterval int
}

Options ...

type Subscriber

type Subscriber struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Subscriber ...

func NewSubscriber

func NewSubscriber(client *Client, topic string, handler msgbus.HandlerFunc) *Subscriber

NewSubscriber ...

func (*Subscriber) Start

func (s *Subscriber) Start()

Start ...

func (*Subscriber) Stop

func (s *Subscriber) Stop()

Stop ...

Jump to

Keyboard shortcuts

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