notifier

package
v0.0.0-...-aa67389 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package notifier implements a Notifier type, which can be used to send broadcast notification to many listeners.

Unlike sync.Cond, here is no delivery guarantee, e.g. if a listener is too busy to pick up the notification, it will be dropped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener[T any] struct {
	C <-chan T
	// contains filtered or unexported fields
}

func (*Listener[T]) Close

func (l *Listener[T]) Close()

type Notifier

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

func (*Notifier[T]) Len

func (n *Notifier[T]) Len() int

func (*Notifier[T]) NewListener

func (n *Notifier[T]) NewListener() *Listener[T]

func (*Notifier[T]) Notify

func (n *Notifier[T]) Notify(value T)

Jump to

Keyboard shortcuts

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