Skip to content

Commit 6a69ab0

Browse files
committed
first commit
0 parents  commit 6a69ab0

File tree

13 files changed

+1530
-0
lines changed

13 files changed

+1530
-0
lines changed

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module demo
2+
3+
go 1.19
4+
5+
require github.com/reugn/go-quartz v0.6.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/reugn/go-quartz v0.6.0 h1:zxpwmyg6kG3lMDyP5L8Agrn+zckd2gKwIaaXNRGwo+g=
2+
github.com/reugn/go-quartz v0.6.0/go.mod h1:no4ktgYbAAuY0E1SchR8cTx1LF4jYIzdgaQhzRPSkpk=

main.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"time"
6+
7+
"github.com/reugn/go-quartz/quartz"
8+
)
9+
10+
func main() {
11+
ctx := context.Background()
12+
sched := quartz.NewStdScheduler()
13+
sched.Start(ctx)
14+
15+
functionJob := quartz.NewFunctionJob(func(_ context.Context) (int, error) { return 42, nil })
16+
sched.ScheduleJob(functionJob, quartz.NewSimpleTrigger(time.Second*5))
17+
sched.Stop()
18+
sched.Wait(ctx)
19+
20+
}

vendor/github.com/reugn/go-quartz/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)