Skip to content

Scheduler can perform actions on cron expression. It uses postgres for storing schedules.

License

Notifications You must be signed in to change notification settings

PSKP-95/scheduler

Repository files navigation

Scheduler

Scheduler can perform actions on cron expression. It uses postgres for storing schedules.

Architecture

The Scheduler App is a Go-based application that manages cronjobs stored in a PostgreSQL database. The application is designed with the following components:

APIs

The API layer is the interface through which clients interact with the Scheduler App. It exposes REST APIs that allow clients to create, read, update, and delete schedules. It also provides endpoints for querying the history of past occurrences.

Data

The data layer consists of the PostgreSQL database that stores the schedules, next_occurrence, and history tables. It is using sqlc for generating database related methods.

Worker

Worker is current running instance of app. It will register itself in database, will own work/schedule occurence, and it will hand over occurence to executor when occurence expire. It is also responsible to unown occurences from dead workers.

Worker's Life

Hooks system & Executor

The hooks system allows for custom actions to be taken when a occurence is expired. Hooks are Go functions that take a context. The context provides access to the necessary data for executing the hook.

Executor's Life

Main Flow

main flow

About

Scheduler can perform actions on cron expression. It uses postgres for storing schedules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published