Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
onatm committed Oct 2, 2024
1 parent 5ec82da commit 254c9bf
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 18 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
# clockwerk

[![Coverage Status](https://coveralls.io/repos/github/onatm/clockwerk/badge.svg?branch=master)](https://coveralls.io/github/onatm/clockwerk?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/onatm/clockwerk/badge.svg?branch=main)](https://coveralls.io/github/onatm/clockwerk?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/onatm/clockwerk)](https://goreportcard.com/report/github.com/onatm/clockwerk)
[![GoDoc](http://godoc.org/github.com/onatm/clockwerk?status.png)](http://godoc.org/github.com/onatm/clockwerk)

Job Scheduling Library

clockwerk allows you to schedule periodic jobs using a simple, fluent syntax.

## Usage
## Installing

Using clockwerk is easy. First, use `go get` to install the latest version of the library.

``` sh
go get github.com/onatm/clockwerk
go get -u github.com/onatm/clockwerk@latest
```

## Usage

Include clockwerk in your application:

```go
import "github.com/onatm/clockwerk"
```

## Example

``` go
package main

Expand Down
29 changes: 14 additions & 15 deletions doc.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
/*
Package clockwerk implements an in-process scheduler for periodic jobs.
Usage
# Usage
Callers may register Jobs to be invoked on a given schedule. Clockwerk will run
them in their own goroutines.
type DummyJob struct{}
func (d DummyJob) Run() {
fmt.Println("Every 30 seconds")
}
...
var job DummyJob
c := clockwerk.New()
c.Every(30 * time.Second).Do(job)
c.Start()
...
// Funcs are invoked in their own goroutine, asynchronously.
...
c.Stop() // Stop the scheduler (does not stop any jobs already running).
type DummyJob struct{}
func (d DummyJob) Run() {
fmt.Println("Every 30 seconds")
}
...
var job DummyJob
c := clockwerk.New()
c.Every(30 * time.Second).Do(job)
c.Start()
...
// Funcs are invoked in their own goroutine, asynchronously.
...
c.Stop() // Stop the scheduler (does not stop any jobs already running).
*/
package clockwerk

0 comments on commit 254c9bf

Please sign in to comment.