Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schedule ¶
type Schedule struct {
// contains filtered or unexported fields
}
Schedule provides a schedule for storage operations, with the following properties:
- fast to add and remove items by key: O(log(n)); n is the total number of items
- fast to identify/remove the next scheduled item: O(log(n))
func NewSchedule ¶
NewSchedule constructs a new schedule, using the given Clock for the Next method.
func (*Schedule) Add ¶
Add adds an item with the specified value, with the corresponding key and time to the schedule. Add will panic if there already exists an item with the same key.
func (*Schedule) Next ¶
Next returns a channel which will send after the next scheduled item's time has been reached. If there are no scheduled items, nil is returned.
Click to show internal directories.
Click to hide internal directories.