send

package
v0.0.0-...-2382a3d Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sender

type Sender struct {

	// This can be used to pass a custom logger to the sender. Left unset it defaults to the log default logger.
	Logger *log.Logger
	// contains filtered or unexported fields
}

Sender sends messages in a reliable way by queueing them and retrying any failed delivery. It is designed to be used only by a single caller and thus not concurrency safe!

func NewSender

func NewSender(queueSize int, endpoint string, logger *log.Logger) *Sender

func (*Sender) EnqueueMessage

func (s *Sender) EnqueueMessage(msg *protocol.SpaceMessage) int

EnqueueMessage adds a message to the delivery queue after assigning it a new ID.

Jump to

Keyboard shortcuts

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