alarm

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Send    chan<- Event
	Receive <-chan Event
}

Alarm resends events at the requested time, or later. Events are always received in the order they've been sent. Closing the Send channel asks the alarm to terminate, which is notified by closing Receive.

func New

func New(chanSize int) Alarm

New creates a new Alarm with the given size for Send. Receive is always unbuffered.

type Event

type Event struct {
	Time time.Time
	Data interface{}
}

Jump to

Keyboard shortcuts

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