timed

package
v0.0.0-...-eab5728 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package timed provides a preemptive shortest time remaining scheduler for timers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Timed

type Timed struct {
	// contains filtered or unexported fields
}

Timed represents a preemptive shortest time remaining scheduler for timers.

func New

func New() *Timed

New creates a new preemptive shortest time remaining scheduler for timers.

func (*Timed) Close

func (t *Timed) Close()

Close closes the scheduler and stops scheduling all pending operations.

Blocks until the scheduler has really been closed and the currently running action has been executed.

func (*Timed) Start

func (t *Timed) Start(at time.Time, action func()) (stop func())

Start schedules a timer at the specified time, executing the specified action when done.

Start also returns a function with which the timer can be stopped and removed from scheduling.

Jump to

Keyboard shortcuts

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