event

package
v0.0.0-...-f92c3b3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

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

func NewEmitter

func NewEmitter[T any]() *Emitter[T]

func (*Emitter[T]) Emit

func (emitter *Emitter[T]) Emit(data T)

func (*Emitter[T]) EmitAsync

func (emitter *Emitter[T]) EmitAsync(data T)

func (*Emitter[T]) EmitAsyncTTL

func (emitter *Emitter[T]) EmitAsyncTTL(data T, hash string, ttl time.Duration)

func (*Emitter[T]) EmitTTL

func (emitter *Emitter[T]) EmitTTL(data T, hash string, ttl time.Duration)

func (*Emitter[T]) Register

func (emitter *Emitter[T]) Register(handler func(event Event, data T)) Event

type Event

type Event interface {
	Close()
}

Jump to

Keyboard shortcuts

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