subscribe

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Subscribe

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

Types

type HostMessage

type HostMessage struct {
	Sender  string
	Message []string
}

type Subscription

type Subscription struct {
	Hosts        []string
	Topics       []string
	HostMessages chan *HostMessage
	// contains filtered or unexported fields
}

func SubscribeMulti

func SubscribeMulti(hosts, 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