subscribe

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0, BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorWaitPatternTimeout = errors.New("timeout in SubscribeRunAndWaitForPattern")

Functions

func ListenForPatternMulti

func ListenForPatternMulti(hosts []string, pattern []string, onFinish func(bool), timeout time.Duration, w ...io.Writer)

noinspection GoUnhandledErrorResult

func Subscribe

func Subscribe(host string, messages chan<- []string, done <-chan bool, keepTrying bool, topics ...string) error

func SubscribeMultiOld

func SubscribeMultiOld(hosts []string, messages chan<- *HostMessage, done chan bool, topics ...string) error

func SubscribeRunAndWaitForPattern

func SubscribeRunAndWaitForPattern(hosts []string, topic string, timeout time.Duration, f func() ([]string, error)) error

Types

type HostMessage

type HostMessage struct {
	Sender  string
	Message []string
}

type Subscription

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

func SubscribeMulti

func SubscribeMulti(hosts []string, topics string, quorum ...int) (*Subscription, error)

func (*Subscription) Close

func (subs *Subscription) Close()

func (*Subscription) WaitForPattern

func (subs *Subscription) WaitForPattern(pattern []string, timeout time.Duration, quorum ...int) bool

func (*Subscription) WaitForPatterns

func (subs *Subscription) WaitForPatterns(patterns [][]string, timeout time.Duration, quorum ...int) bool

WaitForPatterns waits until subscription receives all patterns from quorum of hosts

Jump to

Keyboard shortcuts

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