All Projects → rakanalh → Scheduler

rakanalh / Scheduler

Licence: mit
Task scheduler for Golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Scheduler

croner
Trigger functions and/or evaluate cron expressions in JavaScript. No dependencies. Most features. All environments.
Stars: ✭ 169 (-1.17%)
Mutual labels:  task, cron, scheduler
linda
Linda is a simple dispatcher library.
Stars: ✭ 12 (-92.98%)
Mutual labels:  task, cron, scheduler
josk
🏃🤖 Scheduler and manager for jobs and tasks in node.js on multi-server and clusters setup
Stars: ✭ 27 (-84.21%)
Mutual labels:  task, cron, scheduler
Ppgo job
PPGo_Job是一款可视化的、多人多权限的、一任务多机执行的定时任务管理系统,采用golang开发,安装方便,资源消耗少,支持大并发,可同时管理多台服务器上的定时任务。
Stars: ✭ 1,152 (+573.68%)
Mutual labels:  cron, task
Ects
Elastic Crontab System 简单易用的分布式定时任务管理系统
Stars: ✭ 156 (-8.77%)
Mutual labels:  scheduler, task
Pg cron
Run periodic jobs in PostgreSQL
Stars: ✭ 1,002 (+485.96%)
Mutual labels:  scheduler, cron
Geoip Updater
Download and update MaxMind's GeoIP2 databases on a time-based schedule
Stars: ✭ 29 (-83.04%)
Mutual labels:  scheduler, cron
Heliocron
A command line application written in Rust capable of delaying execution of other programs for time periods relative to sunrise and sunset.
Stars: ✭ 152 (-11.11%)
Mutual labels:  scheduler, cron
Sidekiq Scheduler
Lightweight job scheduler extension for Sidekiq
Stars: ✭ 1,198 (+600.58%)
Mutual labels:  scheduler, cron
Chronus
Chronus是360金融技术团队基于阿里开源项目TBSchedule重写的分布式调度。
Stars: ✭ 166 (-2.92%)
Mutual labels:  scheduler, task
Beatserver
Beatserver, a periodic task scheduler for Django 🎵
Stars: ✭ 106 (-38.01%)
Mutual labels:  scheduler, task
Cronicle
A simple, distributed task scheduler and runner with a web based UI.
Stars: ✭ 979 (+472.51%)
Mutual labels:  scheduler, cron
Deno cron
A cron Job scheduler for Deno that allows you to write human readable cron syntax with tons of flexibility
Stars: ✭ 35 (-79.53%)
Mutual labels:  scheduler, cron
Tiktok
Python web visualize build on the awesome web framework sanic
Stars: ✭ 55 (-67.84%)
Mutual labels:  scheduler, cron
Queuer
Queuer is a queue manager, built on top of OperationQueue and Dispatch (aka GCD).
Stars: ✭ 964 (+463.74%)
Mutual labels:  scheduler, task
Clock
可视化任务调度系统,精简到一个二进制文件 (Web visual task scheduler system , yes ! just one binary solve all the problems !)
Stars: ✭ 86 (-49.71%)
Mutual labels:  scheduler, task
Cronscheduler.aspnetcore
Cron Scheduler for AspNetCore 2.x/3.x or DotNetCore 2.x/3.x Self-hosted
Stars: ✭ 100 (-41.52%)
Mutual labels:  scheduler, cron
Go Quartz
Simple, zero-dependency scheduling library for Go
Stars: ✭ 118 (-30.99%)
Mutual labels:  scheduler, cron
Simple scheduler
An enhancement for Heroku Scheduler + Sidekiq for scheduling jobs at specific times.
Stars: ✭ 127 (-25.73%)
Mutual labels:  scheduler, cron
Crono
A time-based background job scheduler daemon (just like Cron) for Rails
Stars: ✭ 637 (+272.51%)
Mutual labels:  scheduler, cron
  • Go Task Scheduler [[https://travis-ci.org/rakanalh/scheduler][https://img.shields.io/travis/rakanalh/scheduler/master.svg?style=flat-square]] [[http://codecov.io/github/rakanalh/scheduler?branch=master][http://codecov.io/github/rakanalh/scheduler/coverage.svg?branch=master]] [[https://godoc.org/github.com/rakanalh/scheduler][https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square]] [[https://github.com/rakanalh/scheduler/blob/master/LICENSE.txt][https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square]]

Go Task scheduler is a small library that you can use within your application that enables you to execute callbacks (goroutines) after a pre-defined amount of time. GTS also provides task storage which is used to invoke callbacks for tasks which couldn't be executed during down-time as well as maintaining a history of the callbacks that got executed.

** Features

  • Execute tasks based after a specific duration or at a specific point in time
  • Job stores for history & recovery, provided stores out of the box:
  • Sqlite3
  • Redis (Coming soon)
  • Installation #+BEGIN_SRC shell go get github.com/rakanalh/scheduler #+END_SRC

  • How To Use

Instantiate a scheduler as follows:

#+BEGIN_SRC go s := scheduler.New(storage) #+END_SRC

GTS currently supports 2 kinds of storages:

  1. NoOpStorage: Does nothing #+BEGIN_SRC go noOpStorage := storage.NewNoOpStorage() #+END_SRC
  2. MemoryStorage: Does nothing #+BEGIN_SRC go memStorage := storage.NewMemoryStorage() #+END_SRC
  3. SqliteStorage: Persists tasks into a SQLite3 database. #+BEGIN_SRC go sqliteStorage := storage.NewSqlite3Storage() #+END_SRC

Example: #+BEGIN_SRC go storage := storage.NewSqlite3Storage( storage.Sqlite3Config{ DbName: "db.store", }, ) if err := storage.Connect(); err != nil { log.Fatal("Could not connect to db", err) }

if err := storage.Initialize(); err != nil { log.Fatal("Could not intialize database", err) } #+END_SRC

and then pass it to the scheduler.

Scheduling tasks can be done in 3 ways:

** Execute a task after 5 seconds. #+BEGIN_SRC go func MyFunc(arg1 string, arg2 string) taskID := s.RunAfter(5*time.Second, MyFunc, "Hello", "World") #+END_SRC

** Execute a task at a specific time. #+BEGIN_SRC go func MyFunc(arg1 string, arg2 string) taskID := s.RunAt(time.Now().Add(24 * time.Hour), MyFunc, "Hello", "World") #+END_SRC

** Execute a task every 1 minute. #+BEGIN_SRC go func MyFunc(arg1 string, arg2 string) taskID := s.RunEvery(1 * time.Minute, MyFunc, "Hello", "World") #+END_SRC

  • Examples

The [[https://github.com/rakanalh/scheduler/tree/master/_example/][Examples]] folder contains a bunch of code samples you can look into.

  • Custom Storage

GTS supports the ability to provide a custom storage, the newly created storage has to implement the TaskStore interface

#+BEGIN_SRC go type TaskStore interface { Store(task *TaskAttributes) error Remove(task *TaskAttributes) error Fetch() ([]TaskAttributes, error) } #+END_SRC

TaskAttributes looks as follows: #+BEGIN_SRC go type TaskAttributes struct { Hash string Name string LastRun string NextRun string Duration string IsRecurring string Params string } #+END_SRC

  • TODOs
  • [ ] Design a cron-like task schedule for RunEvery method
  • Credit This package is heavily inspired by [[https://github.com/agronholm/apscheduler/][APScheduler]] for Python & [[https://github.com/jasonlvhit/gocron][GoCron]]

  • License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].