Skip to content
A small scheduling library for Go which makes running tasks at different times easy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
strat
.travis.yml
README.md
active_task.go
active_task_test.go
examples_test.go
strategies.go
strategies_test.go
task.go
task_test.go

README.md

Scheduler Build Status

An idiomatic Go library providing extensible task scheduling capabilities

Scheduler provides a framework on which you can quickly and easily schedule tasks through a series of pluggable scheduling strategies. It aims to offer a straightforward approach to task scheduling with simple execution cancellation, error handling and an idiomatic API.

package example

import(
    "log"
    "time"

    "github.com/SierraSoftworks/scheduler"
)

func Example_Schedule() {
    s := scheduler.
        Do(func(t time.Time) error {
            log.Print("Running scheduled task")
            return nil
        }).
        Every(30 * time.Second).
        WithHandler(func (errs <-chan error) {
            for err := range errs {
                log.Printf("Failed: %s\n", err.Error())
            }
        })
        Schedule()

    s.CancelWhen(time.After(2 * time.Minute))
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.