async

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New[E any](log *slog.Logger, client *redis.Client, streamNamePrefix string) (Notifier[E], Waiter[E])

Types

type Notifier

type Notifier[E any] interface {
	// Notify allows adding an element to the stream which will then be delivered to the waiters.
	// messages fan out to all waiters.
	Notify(ctx context.Context, elem E) error
}

type Waiter

type Waiter[E any] interface {
	// Wait receives elements from the stream starting from the point in time when this function is called.
	// when the context is done, the channel gets closed.
	Wait(ctx context.Context) <-chan E
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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