{"repo":"libi/dcron","free":true,"listed":false,"github":"https://github.com/libi/dcron","clone":"git clone https://github.com/libi/dcron.git","description":"轻量分布式定时任务库 a lightweight distributed job scheduler library","language":"Go","stars":464,"topics":["cron","crontab","distributed","distributed-cron","consistent-hashing","redis"],"license":"MIT","category":"databases-storage","readme_excerpt":"Dcron ============== 简体中文 English a lightweight distributed job scheduler library based on redis or etcd Theory Use redis or etcd to sync the services list and the state of services. Use consistent-hash to select the node which can execute the task. Why not use distributed-lock? If use distributed-lock to implement it. I will depends on the system-time of each node. There are some problems when the system-time is not synchronous: 1. If the task executing time is shorter than the system time, the task will be excuted again. (some node unlock after execution, but the lock will be locked by the other node which reach the execution time) 2. Whatever there is only a little miss in system time, the most fast node will catch the lock in the first time. It will cause a thing that all the task will be executed only by the most fast node. Features - Robustness: The node assignment of tasks does not depend on the system time, so the system time error between nodes can also ensure uniform distribution and single node execution. - Load Balance: Distribute tasks evenly according to task and node. - Seamless capacity extention ：If the load of the task node is too large, some tasks will be automatically migrated to the new service after the new server is started directly to achieve seamless capacity extention. - Failover: If a single node fails, the task will be automatically transferred to other normal nodes after 10 seconds. - Unique: The same task in the same service will only start a sin","default_branch":null,"files":null,"tree":[],"storefront":"/r/libi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/libi/dcron/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}