driver

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	// Subscribe's channel also receives messages published to descendant topics.
	Subscribe(name string, topic string) (<-chan entity.PubsubMessage, error)

	GetSubscribers(topic string) []string

	// Unsubscribe closes the subscriber's channel.
	Unsubscribe(name string, topic string) error

	// Publish skips self-delivery to from; ctx bounds only the cross-instance hop, so delivery can be partial.
	Publish(ctx context.Context, from string, topic string, kind string, payload any) error

	common.Daemon
}

func NewKafka

func NewKafka(brokers []string, groupID string, log log.Logger, opts ...Option) (Driver, error)

func NewMemory

func NewMemory(log log.Logger, opts ...Option) Driver

func NewRedis

func NewRedis(client *redis.Client, log log.Logger, opts ...Option) (Driver, error)

type OnFull added in v0.4.9

type OnFull int
const (
	// DropMessage is silent: the subscriber never learns it missed one.
	DropMessage OnFull = iota
	// DropSubscriber closes the channel, so a subscriber resuming from its own cursor loses nothing.
	DropSubscriber
)

type Option added in v0.4.9

type Option func(*options)

func WithChannelBuffer added in v0.4.9

func WithChannelBuffer(n int) Option

func WithOnFull added in v0.4.9

func WithOnFull(v OnFull) Option

func WithQueueCap added in v0.4.9

func WithQueueCap(n int) Option

type Stats added in v0.4.9

type Stats interface {
	Dropped() uint64
	Evicted() uint64
}

Jump to

Keyboard shortcuts

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