Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schedule ¶
type Schedule[K comparable, V any] struct { // contains filtered or unexported fields }
Schedule tracks unique values ordered by time. It is not thread-safe.
func New ¶
func New[K comparable, V any](hash func(V) K) *Schedule[K, V]
New creates a new Schedule. The hash function is used to determine a comparable key for a value.
func (Schedule[K, V]) Pop ¶
func (s Schedule[K, V]) Pop() V
Pop removes the value with the earliest time from the schedule and returns it. It will panic if the schedule is empty.
Click to show internal directories.
Click to hide internal directories.