pubsub

package
v0.22.8 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandleT

type HandleT uint32
const (
	InvalidHandle HandleT = 0
)

type NotifierFunc

type NotifierFunc[NotificationT any] func(ctx context.Context, ss *SubscriptionSet[NotificationT])

type Subscription

type Subscription[NotificationT any] struct {
	Handle HandleT
	// contains filtered or unexported fields
}

func NewSubscription

func NewSubscription[NotificationT any](owner *SubscriptionSet[NotificationT], sink chan<- NotificationT) *Subscription[NotificationT]

func (*Subscription[NotificationT]) Cancel

func (es *Subscription[NotificationT]) Cancel()

func (*Subscription[NotificationT]) Cancelled

func (es *Subscription[NotificationT]) Cancelled() bool

func (*Subscription[NotificationT]) Notify

func (es *Subscription[NotificationT]) Notify(n NotificationT)

type SubscriptionSet

type SubscriptionSet[NotificationT any] struct {
	// contains filtered or unexported fields
}

The subscription set helps manage a set of subscriptions that share the same source of notifications.

func NewSubscriptionSet

func NewSubscriptionSet[NotificationT any](notifierFunc NotifierFunc[NotificationT], parentCtx context.Context) *SubscriptionSet[NotificationT]

func (*SubscriptionSet[NotificationT]) CancelAll

func (ss *SubscriptionSet[NotificationT]) CancelAll()

func (*SubscriptionSet[NotificationT]) Notify

func (ss *SubscriptionSet[NotificationT]) Notify(n NotificationT)

func (*SubscriptionSet[NotificationT]) Subscribe

func (ss *SubscriptionSet[NotificationT]) Subscribe(sink chan<- NotificationT) *Subscription[NotificationT]

Jump to

Keyboard shortcuts

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