topic

package
v0.0.0-...-ff439f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ErrConsumerNotClosed = "consumer finalized without being closed: %s"
	ErrProducerNotClosed = "producer finalized without being closed: %s"
)

Error messages

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer[Msg any] interface {
	message.ClosingReceiver[Msg]
	Identified
}

Consumer exposes a way to receive messages from its associated Topic. Each Consumer created independently tracks its own position within the Topic

type Identified

type Identified interface {
	// ID returns the identifier for this resource
	ID() id.ID
}

Identified is any resource that can be uniquely identified

type Length

type Length uint64

Length is the potential size of a Topic stream

type Producer

type Producer[Msg any] interface {
	message.ClosingSender[Msg]
	Identified
}

Producer exposes a way to push messages to its associated Topic. messages pushed to the Topic are capable of being independently received by all Consumers

type Topic

type Topic[Msg any] interface {
	// Length returns the current virtual size of the Topic
	Length() Length

	// NewProducer returns a new Producer for this Topic
	NewProducer() Producer[Msg]

	// NewConsumer returns a new Consumer for this Topic
	NewConsumer() Consumer[Msg]
}

Topic is where you put your stuff. They are implemented as a first-in-first-out (FIFO) Log.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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