分布式计划任务运行框架 LiteCron

码农软件 · 软件分类 · 作业/任务调度 · 2019-09-04 08:57:11

软件介绍

LiteCron 是一个基于 Go 的分布式计划任务运行框架,可以很容易的集成到 web app 中。它基于 Redis 实现分布式锁,无需特别的存储依赖。

案例

  • 在 web app 中运行计划任务。

  • 构建分布式计划任务服务以替换系统计划任务服务。

用法

//Step 1: init default cron client.
	litecron.InitDefaultCron(&litecron.MutexConfig{
		RedisConfig:&litecron.RedisConfig{
			DNS:"127.0.0.1:6379",
		},
		Prefix:"litecron/examples/defaults/",
		Factor:0.01,
	})
	//Register a cron job for every 2 seconds.
	litecron.Register("@every 2s",exampleHandle)
	go litecron.Run()
	time.Sleep(10 * time.Second)
	// Output:

Demo

  1. default cron client

  2. without default cron client

  3. mock multi processor

本文地址:https://codercto.com/soft/d/13840.html

The Dream Machine

The Dream Machine

M. Mitchell Waldrop / Penguin Books / 2002-8 / USD 16.00

While most people may not be familiar with the name J. C. R. Licklider, he was the guiding spirit behind the greatest revolution of the modern era. At a time when most computers were big, ponderous ma......一起来看看 《The Dream Machine》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具