subscribers

package
v1.4.11 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Subscriber

type Subscriber[T any] struct {
	// contains filtered or unexported fields
}

Subscriber represents a single subscriber with a context and a channel

type Subscribers

type Subscribers[T any] interface {
	// Push adds a new subscriber
	Push(ctx context.Context, ch chan<- T)
	// SendAll sends a message to all subscribers
	SendAll(message T)
	// CleanDone removes subscribers whose context is done
	CleanDone()
}

Subscribers is the interface for managing subscribers of type T

func NewSubscribers

func NewSubscribers[T any]() Subscribers[T]

NewSubscribers creates a new Subscribers instance

Jump to

Keyboard shortcuts

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