Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TimedEntry ¶
type TimedEntry struct {
// contains filtered or unexported fields
}
func (TimedEntry) Value ¶
func (t TimedEntry) Value() interface{}
Value returns the value of the entry
type TimedList ¶
type TimedList struct { C chan interface{} // contains filtered or unexported fields }
func (*TimedList) Add ¶
func (t *TimedList) Add(v interface{}, d time.Duration) (item *TimedEntry)
Add adds v to the list with duration d
It refreshes the timer if the new element will expire before the current timer
func (*TimedList) Drain ¶
func (t *TimedList) Drain()
Drain drains the list into the channel
It calls stop after draining the list
func (*TimedList) Purge ¶
func (t *TimedList) Purge()
Purge removes all elements from the list and then calls stop
func (*TimedList) Remove ¶
func (t *TimedList) Remove(te *TimedEntry) (v interface{})
Remove removes te from the list.
It calls stop if the list is empty after removing the element.
It returns the value of the element removed.
Click to show internal directories.
Click to hide internal directories.