Comments (4)
API感觉还能继续优化一下,我觉得有2个点:
- 已经把cron内置了,所以dcron的初始化函数可以和cron一样了.最终实现的效果就是之前使用cron的用户只需要替换包名就能无缝替换. 如果需要启用分布式,附加带driver的配置即可.
- driver包独立:项目本身依赖的三方库其实并不多,主要是各个driver引入带来的间接引入.所以可以考虑将driver目录整合一下提取出接口,具体实现都使用独立包含go.mod的子目录(一个仓库下的多个go mod). 这样对于只使用主项目时的依赖会非常简洁.
from dcron.
关于driver包独立: 这两天尝试了一下发现想要独立出去略微有些困难,有一种方法是对于每一个driver新开一个repo,要在一个仓库下的话,可能就要用go work来共同管理了
每个driver新开一个 repo 和 使用子目录新的go.mod实现基本是一样的, 如果子目录下有go.mod 这个子目录对于go就是一个独立的包名,不会受到主仓库的影响。
from dcron.
关于driver包独立:
这两天尝试了一下发现想要独立出去略微有些困难,有一种方法是对于每一个driver新开一个repo,要在一个仓库下的话,可能就要用go work来共同管理了
from dcron.
https://github.com/dxyinme/dcron/tree/dxyinme/move-driver-to-inner-mod/driver
正在做这部分的工作,具体进度可以在这个branch里面看到
- 抽取实现driver需要的公共方法作为一个新的go mod
- 独立出etcd driver
- 独立出redis driver
- 独立出redis zset driver
- 独立出integration test
- 独立出examples
- 增加拆分go mod之后的test coverage
- 让github actions可以测试到所有的mod
from dcron.
Related Issues (20)
- 能否发布一个新的release HOT 2
- [Question] 故障转移是怎样实现的?具体逻辑在哪里?为什么是10秒?这个时间可以配置吗? HOT 1
- 新增Driver:仅靠节点间通信同步状态 HOT 2
- 可以考虑包内实现定时任务库 HOT 8
- 添加bash支持 HOT 1
- 提交PR建议 HOT 3
- 集群稳定性维护 HOT 3
- 任务不会平均分配 HOT 5
- 准备做一个具体的应用,可以让大家对dcron的流程进行手动更新和调研 HOT 1
- 可以支持固定间隔的定时任务吗 HOT 1
- 无法打印输出cron的全量日志 HOT 1
- go.opentelemetry.io/otel/metric/sdkapi: module go.opentelemetry.io/otel/metric@latest found (v1.19.0), but does not contain package go.opentelemetry.io/otel/metric/sdkapi HOT 5
- ERR: node pool is empty HOT 4
- 增加codecov看板 HOT 3
- redis内数据量比较大的情况下导致的异常? HOT 1
- 不支持redis集群? HOT 2
- 不支持go1.20 21吗? HOT 1
- stop优化 HOT 3
- api没有recover方法
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcron.