pubsub

package
v0.0.0-...-777230d Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backoff

func Backoff(initialBackoff, maxBackoff time.Duration, maxCalls int, f func() error) error

Do retries the function f backing off the double of time each retry until a successfully call is made. initialBackoff is minimal time to wait for the next call maxBackoff is the maximum time between calls, if is 0 there is no maximum maxCalls is the maximum number of call to the function, if is 0 there is no maximum

Types

type CommError

type CommError struct {
	Message []byte
	Name    string
	CommErr error
}

Err represents a vice error.

func (*CommError) Error

func (e *CommError) Error() string

type PSMQ

type PSMQ interface {
	Init()
	SubscribeToTopic(name string) <-chan []byte   //Subscribe to a topic
	CreatePublishTopic(name string) chan<- []byte //Create a publicaton topic
	ErrChan() chan error
	Close()
	Done() chan struct{}
}

type QueueType

type QueueType int
const (
	NSQ      QueueType = 0
	REDIS    QueueType = 1
	GOCH     QueueType = 2
	KAFKA    QueueType = 3
	NATS     QueueType = 4
	RABBITMQ QueueType = 5
	ZEROMQ   QueueType = 6
)

Directories

Path Synopsis
mqs
nsq

Jump to

Keyboard shortcuts

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