Giter VIP home page Giter VIP logo

Comments (4)

libi avatar libi commented on August 17, 2024 1

API感觉还能继续优化一下,我觉得有2个点:

  1. 已经把cron内置了,所以dcron的初始化函数可以和cron一样了.最终实现的效果就是之前使用cron的用户只需要替换包名就能无缝替换. 如果需要启用分布式,附加带driver的配置即可.
  2. driver包独立:项目本身依赖的三方库其实并不多,主要是各个driver引入带来的间接引入.所以可以考虑将driver目录整合一下提取出接口,具体实现都使用独立包含go.mod的子目录(一个仓库下的多个go mod). 这样对于只使用主项目时的依赖会非常简洁.

from dcron.

libi avatar libi commented on August 17, 2024 1

关于driver包独立: 这两天尝试了一下发现想要独立出去略微有些困难,有一种方法是对于每一个driver新开一个repo,要在一个仓库下的话,可能就要用go work来共同管理了

每个driver新开一个 repo 和 使用子目录新的go.mod实现基本是一样的, 如果子目录下有go.mod 这个子目录对于go就是一个独立的包名,不会受到主仓库的影响。

from dcron.

dxyinme avatar dxyinme commented on August 17, 2024

关于driver包独立:
这两天尝试了一下发现想要独立出去略微有些困难,有一种方法是对于每一个driver新开一个repo,要在一个仓库下的话,可能就要用go work来共同管理了

from dcron.

dxyinme avatar dxyinme commented on August 17, 2024

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)

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.