msgbus: github.com/prologic/msgbus/client Index | Files

package client

import "github.com/prologic/msgbus/client"

Index

Package Files

client.go

Constants

const (
    // DefaultReconnectInterval ...
    DefaultReconnectInterval = 2

    // DefaultMaxReconnectInterval ...
    DefaultMaxReconnectInterval = 64
)

type Client Uses

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

Client ...

func NewClient Uses

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

NewClient ...

func (*Client) Handle Uses

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

Handle ...

func (*Client) Publish Uses

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

Publish ...

func (*Client) Pull Uses

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

Pull ...

func (*Client) Subscribe Uses

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

Subscribe ...

type Options Uses

type Options struct {
    ReconnectInterval    int
    MaxReconnectInterval int
}

Options ...

type Subscriber Uses

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

Subscriber ...

func NewSubscriber Uses

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

NewSubscriber ...

func (*Subscriber) Start Uses

func (s *Subscriber) Start()

Start ...

func (*Subscriber) Stop Uses

func (s *Subscriber) Stop()

Stop ...

Package client imports 14 packages (graph) and is imported by 2 packages. Updated 2019-01-07. Refresh now. Tools for package owners.