Skip to content

Commit

Permalink
update readme (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
dxyinme authored Sep 10, 2024
1 parent 0bac197 commit d0a1177
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If use distributed-lock to implement it. I will depends on the system-time of ea
redisCli := redis.NewClient(&redis.Options{
Addr: DefaultRedisAddr,
})
drv := driver.NewRedisDriver(redisCli)
drv := redisdriver.NewDriver(redisCli)
dcron := NewDcron("server1", drv)
```
2. Use cron-language to add task, you should set the `TaskName`, the `TaskName` is the primary-key of each task.
Expand All @@ -55,6 +55,10 @@ dcron.Start()
// blocking start.
dcron.Run()
```
### Drivers

After v0.6.0, We split out Dcron's drivers like etcddriver and redisdriver from main repo, and maintain them in independent repos. For details, please refer to [dcron-contrib](https://github.com/dcron-contrib).


### Example
- [examples](examples/)
Expand Down
5 changes: 4 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ a lightweight distributed job scheduler library based on redis or etcd
redisCli := redis.NewClient(&redis.Options{
Addr: DefaultRedisAddr,
})
drv := driver.NewRedisDriver(redisCli)
drv := redisdriver.NewDriver(redisCli)
dcron := NewDcron("server1", drv)
```
当然,如果你可以自己实现一个自定义的Driver也是可以的,只需要实现[DriverV2](driver/driver.go)接口即可。
Expand All @@ -55,6 +55,9 @@ dcron.Start()
// 使用当前协程同步启动任务,会阻塞当前协程后续逻辑执行
dcron.Run()
```
### Drivers

在v0.6.0版本之后,Dcron将所有的driver从主仓库拆分,并放置在独立仓库进行维护, 详见 [dcron-contrib](https://github.com/dcron-contrib)

### 使用案例
- [examples](examples/)
Expand Down

0 comments on commit d0a1177

Please sign in to comment.