-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
# Scheduler Package | ||
# Scheduler Package | ||
|
||
## Overview | ||
This package provides a task scheduler in Go with support for both static and predictive scheduling of tasks. | ||
|
||
### Features | ||
- **Static Scheduling:** Schedule tasks with cron-like syntax. | ||
- **Predictive Scheduling:** Automatically estimate future execution times based on runtime behavior. | ||
- **Extensible Design:** Easy to add custom matchers or prediction models. | ||
|
||
### Installation | ||
```sh | ||
go get github.com/escabora/scheduler | ||
``` | ||
|
||
### Usage | ||
```go | ||
import ( | ||
"github.com/escabora/scheduler/internal/core" | ||
) | ||
|
||
func main() { | ||
s := core.NewScheduler() | ||
|
||
s.AddTask("* * * * *", func() { | ||
fmt.Println("Running static task") | ||
}) | ||
|
||
s.Start() | ||
defer s.Stop() | ||
} | ||
``` | ||
|
||
### Testing | ||
Run tests with: | ||
```sh | ||
go test ./tests/... | ||
``` |