Go语言中文网 为您找到相关结果 2

分布式定时任务库dcron分布式定时任务库

## dcron 分布式定时任务库 ### 原理 基于redis同步节点数据,模拟服务注册。然后将任务名 根据一致性hash 选举出执行该任务的节点。 ### 流程图 ![dcron流程图](https://github.com/LibiChai/dcron/raw/master/dcron.png) ### 特性 - 负载均衡:根据任务数据和节点数据均衡分发任务。 - 无缝扩容:如果任务节点负载过大,直接启动新的服务器后部分任务会自动迁移至新服务实现无缝扩容。 - 故障转移:单个节点故障,10s后会自动将任务自动转移至其他正常节点。 - 任务唯一:同一个服务内同一个任务只会启动单个运行实例,不会重复执行。 - 自定义存储:通过实现driver接口...阅读全文

开源项目 2019-08-13 15:14:20 LibiChai

go多协程定时任务调度ConcurrencyCron

ConcurrentCron is a task scheduler that supports high concurrency at the same time which lets you run Go functions periodically at pre-determined interval using a simple, human-friendly syntax. You can run this scheduler in the following way func test(num int) { fmt.Println("before:im a task", num) time.Sleep(10 * time.Second) fmt.Print...阅读全文

开源项目 2019-11-13 16:04:50