Giter Club home page Giter Club logo

jelly-schedule's Introduction

jelly-schedule

这是一个轮子, 公司定时任务太多, 太繁杂, 需要一个轮子来管理

目前正在开发中ing

v0.1.0 基本版本

Todo

  • 参数的规范化设计
  • 每个任务增加是否立即实行,以及delay的时间参数 毕竟cron是要等下一个时间周期的
  • 基于name的选择job执行(目前是基于id), 考虑到打洞
  • 完善文档 (可能永远都不会完成)
  • 日志搜集与查询
  • k8s支持
  • jobId 不存在的时候, 任务执行失败
  • loop 不知道什么时候结束 没必要
  • loop 工作方式可以优化效率, a-b-c c执行了, a执行完了 就可以执行b了

linux

env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o api_x cmd/api/main.go

pprof

go tool pprof -http=:6060 --seconds 30 http://localhost:6060

go build -o api cmd/api/main.go && ./api --etcd 172.3.0.122:2379 --port 23808

设计概念

调度:

  • cron (定时调度)
  • api (user自定义触发)

trggier

  • cron
  • replay

job:

代表一个独立逻辑 没有独立调度时间

  • rpc job(需要编程)
  • shell job
  • http job

工作流: workflow

支持数据的传递 工作流代表一个完整的任务, 每个任务,都有由1个或多个job组成

编程模型

a -> b -> c 顺序执行 = a and b and c a | b | c 并发执行 = a or b or c

replace go.etcd.io/etcd => github.com/etcd-io/etcd v3.3.22+incompatible

参考:

  1. https://github.com/betterde/ects
  2. https://github.com/busgo/forest

version

  • 0.1.0 string参数版本
  • 0.1.1 jobrequest 参数版本

antlr4 -Dlanguage=Go -o parser Expr.g4

测试用例 job: a b c d op: and or loop

and or loop

and_and or_or loop_loop

and_or_loop: EchoJob_id and (EchoJob_id or EchoJob_id) loop EchoJob_id and_loop_or: EchoJob_id and EchoJob_id loop EchoJob_id or (EchoJob_id or EchoJob_id) or_and_loop: (EchoJob_id or EchoJob_id) and EchoJob_id loop EchoJob_id or_loop_and loop_and_or loop_or_a

EchoJob_id and A EchoJob_id and (EchoJob_id or EchoJob_id) loop EchoJob_id: A loop EchoJob_id EchoJob_id and (EchoJob_id or EchoJob_id)

jelly-schedule's People

Contributors

linger1216 avatar

Watchers

James Cloos avatar  avatar

Forkers

devister

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.