Skip to content

About

(module) A Go cron scheduler library with task dependency chains, execution timeouts, and graceful shutdown

Topics

Resources

Stars

37 stars

Watchers

1 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

Note

This README was generated by SKILL, get the ZH version from here.


SCHEDULE TASKS WITH DEPENDENCIES, TIMEOUTS, AND CRON EXPRESSIONS

Go Reference Release License Coverage
Mentioned in Awesome Go


A Go scheduling library with task dependency chains, execution timeouts, and cron expressions

Table of Contents

Features

go get github.com/pardnchiu/go-scheduler@latest · Documentation

  • Task Dependency Chains — Declare prerequisites with []Wait and choose Stop or Skip when a prerequisite fails.
  • Timeouts and Callbacks — Cap each task's execution time; a timeout fires a callback and marks the task failed.
  • Cron, Descriptors, and Intervals — Mix 5-field cron, descriptors such as @daily, and @every intervals.
  • Min-Heap Event Loop — A min-heap tracks next fire times, so tasks can be added or removed while running.
  • Graceful Shutdown — Stop returns a context that completes only after in-flight tasks finish.

Architecture

Full Architecture

graph TB

    App[Caller] --> Cron[Cron Scheduler]
    Cron --> Parser[Expression Parser]
    Cron --> Heap[Task Min-Heap]
    Heap --> Loop[Event Loop]
    Loop -->|no deps| Runner[Task Execution]
    Loop -->|has deps| Depend[Dependency Subsystem]
    Depend --> Workers[Worker Pool]
    Workers --> Runner
    Runner --> State[State Update]
Loading

License

This project is licensed under the MIT LICENSE.

Author

Just open an issue to share an idea.

go-scheduler contributors

©️ 2025 邱敬幃 Pardn Chiu

About

(module) A Go cron scheduler library with task dependency chains, execution timeouts, and graceful shutdown

Topics

Resources

Stars

37 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages