当前位置: 首页 > news >正文

linux空间做网站营销网站建设制作

linux空间做网站,营销网站建设制作,如何做网站引流,wordpress注册会员插件背景 司内线上服务有很多异步脚本,大量冗余代码,管理很不方便 急需一个美丽的框架,让代码变得美好 包 go get github.com/go-co-op/gocron/v2 介绍 gocron is a job scheduling package which lets you run Go functions at pre-determined intervals. 概念 Job Job封…

背景

司内线上服务有很多异步脚本,大量冗余代码,管理很不方便
急需一个美丽的框架,让代码变得美好

go get github.com/go-co-op/gocron/v2

介绍

gocron is a job scheduling package which lets you run Go functions at pre-determined intervals.

概念

  • Job
    Job封装(encapsulates)一个“任务task”,它由一个go函数和任意函数参数组成。
    该作业向调度程序提供该作业下次应计划运行的时间。
    The Job then provides the scheduler with the time the job should next be scheduled to run.

  • Scheduler
    调度程序跟踪(keeps track of)所有作业,并在每个作业准备好运行时将其发送到执行程序。
    The scheduler sends each job to the executor when it is ready to be run

  • Executor
    执行器调用作业的任务并管理不同作业执行时序要求的复杂性
    manages the complexities of different job execution timing requirements
    例如
    单例singletons不应相互溢出(overrun each other)
    限制运行的作业的最大数量 imiting the max number of jobs running)

能力

Job types

Jobs can be run at various intervals.

Duration: Jobs can be run at a fixed time.Duration.
Random duration: Jobs can be run at a random time.Duration between a min and max.
Cron: Jobs can be run using a crontab.
Daily: Jobs can be run every x days at specific times.
Weekly: Jobs can be run every x weeks on specific days of the week and at specific times.
Monthly: Jobs can be run every x months on specific days of the month and at specific times.
One time: Jobs can be run once at a specific time. These are non-recurring jobs.
可以以各种形式执行:a fixed time.Duration、a random time.Duration between a min and max、crontab、every x days at specific times、every x weeks on specific days of the week and at specific times、every x months on specific days of the month and at specific times、run once at a specific time
非经常性工作:non-recurring jobs

Concurrency Limits

Jobs can be limited individually or across the entire scheduler.
可以单独或跨整个scheduler限制Job。

Per job limiting with singleton mode: Jobs can be limited to a single concurrent execution that either reschedules (skips overlapping executions) or queues (waits for the previous execution to finish).
Per scheduler limiting with limit mode: Jobs can be limited to a certain number of concurrent executions across the entire scheduler using either reschedule (skip when the limit is met) or queue (jobs are added to a queue to wait for the limit to be available).
Note: A scheduler limit and a job limit can both be enabled.

Distributed instances of gocron

Multiple instances of gocron can be run.
多实例

Elector: An elector can be used to elect a single instance of gocron to run as the primary with the other instances checking to see if a new leader needs to be elected.
elector用于选择一个 gocron 实例作为主(primary)实例运行,其他实例则检查是否需要选举新的领导者。
Implementations: go-co-op electors

Locker: A locker can be used to lock each run of a job to a single instance of gocron.
Locker可用于将作业的每次运行锁定到 gocron 的单个实例
Implementations: go-co-op lockers

我用的是redis实现的分布式

Events

Job events can trigger actions.

Listeners

Can be added to a job, with event listeners, or all jobs across the scheduler to listen for job events and trigger actions.
可以添加到具有事件侦听器( event listeners)的作业或调度程序中的所有作业中,以侦听作业事件并触发操作

http://www.wangmingla.cn/news/156648.html

相关文章:

  • 装修企业网站源码网址收录入口
  • 做网站用别人图片文章会侵权吗seo技术培训唐山
  • 长沙做网站智投未来深圳百度关键词
  • 网站建设项目需求分析报告百度浏览器网页版入口
  • 网站竞争对手如何做调研本地服务推广平台哪个好
  • 做外汇看哪些网站关键词优化seo外包
  • 做外贸网站渠道搜索引擎优化的定义是什么
  • 网站如何做映射重庆seo排名扣费
  • 滁州市建设工程质量检测协会网站seo技巧seo排名优化
  • 企业做增资 网站平台苏州百度推广服务中心
  • 当下网站建设成都网站优化排名
  • 网乐科技网站建设关键词搜索引擎排名查询
  • 成都网站建设 3e网站建设优秀网站设计赏析
  • 商城网站定制建设价位windows优化大师兑换码
  • 做兼职工作上哪个网站招聘个人在百度上发广告怎么发
  • 搭建网站 阿里云软文推广方案
  • 网站建设图片链接方法静态网站开发
  • 苏州市郭巷建设局网站三台网站seo
  • 涪陵网站建设公司百度的网址怎么写
  • 德网站建设对网络营销的理解
  • 开网站做销售马鞍山seo
  • 北海哪家公司做网站建设研发网上竞价
  • 收费网站建设今日热点新闻2022
  • 响水做网站的价格推广电话
  • 哈尔滨住房建设发展集团网站搜索引擎优化指的是什么
  • 太原模板建站系统营销型网站建设策划书
  • 仿魔酷阁网站源码湖南省人民政府
  • 关于产品网站建设的问题专业营销团队公司
  • 怎么做网站的浏览量业务推广网站
  • 做外贸网站报价单教育培训机构推荐