eventq

package
v2.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 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 EventQueue

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

func New

func New[T any](discardAfter time.Duration, discardFn func(T)) EventQueue[T]

New provides a queue for sending messages to one or more subscribers. Messages are held for the given discardAfter duration if there are no subscribers.

func (*EventQueue[T]) Send

func (eq *EventQueue[T]) Send(event T)

func (*EventQueue[T]) Shutdown

func (eq *EventQueue[T]) Shutdown()

func (*EventQueue[T]) Subscribe

func (eq *EventQueue[T]) Subscribe() (<-chan T, io.Closer)

Jump to

Keyboard shortcuts

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