Workq 作业调度服务器 Workq

xuanbao • 3462 次点击    
这是一个分享于 的项目,其中的信息可能已经有所发展或是发生改变。
Workq 是一个用 Go 开发的作业调度服务器。主要特性: * 异步和同步的作业处理 * 提交作业,然后在作业完成后返回结果,最多等待 TTL * 提交作业并马上获得执行结果 在任意时间临时安排作业调度 使用数值表示作业优先级 可以制定每个作业的 [TTR](https://github.com/iamduo/workq#ttr---time-to-run) (time-to-run) - 限制最大执行时间 可以制定每个作业的 [TTL](https://github.com/iamduo/workq#ttl---time-to-live) 超时 - 限制作业最大存活时间 每个作业可单独设置重试策略,包括 [max-attempts](https://github.com/iamduo/workq#max-attempts) 和 [max-fails](https://github.com/iamduo/workq#max-fails) 参数 示例代码: <pre class="brush:cpp ;toolbar: true; auto-links: false;">job := &amp;workq.FgJob{     ID: &#34;6ba7b810-9dad-11d1-80b4-00c04fd430c4&#34;,     Name: &#34;ping&#34;,     TTR: 5000,          // 5 second time-to-run limit     Timeout: 60000,         // Wait up to 60 seconds for a worker to pick up.     Payload: []byte(&#34;ping&#34;),     Priority: 10,       // @OPTIONAL Numeric priority, default 0. } result, err := client.Run(job) if err != nil {   // ... } fmt.Printf(&#34;Success: %t, Result: %s&#34;, result.Success, result.Result)</pre>
授权协议:
MPL
开发语言:
Google Go 查看源码»
操作系统:
跨平台
3462 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传