consumer

package
v0.0.0-...-cf97348 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	shezmu.BaseDaemon
	// contains filtered or unexported fields
}

Consumer extends Shezmu's BaseDaemon with pub/sub features.

func (*Consumer) Publish

func (c *Consumer) Publish(topic string, msg []byte, meta interface{})

Publish sends a message to the publisher.

func (*Consumer) Subscribe

func (c *Consumer) Subscribe(topic string, fun interface{})

Subscribe subscriasdsdfsdgdfgdfsg sdgsdfg sdfgs dfgdfgdfg.

type Publisher

type Publisher interface {
	Publish(topic string, msg []byte, meta interface{})
	Close()
}

Publisher is the interface that wraps message publishers. Error handling should be provided by the implementation. Feel free to panic.

type Streamer

type Streamer interface {
	Messages() <-chan []byte
	Close()
}

Streamer is the interface that wraps message consumers. Error handling should be provided by the implementation. Feel free to panic.

type Subscriber

type Subscriber interface {
	Subscribe(consumerName, topic string) Streamer
}

Subscriber is the interface that is used by daemons to subscribe to messages.

Jump to

Keyboard shortcuts

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