cmdstalk, beanstalkd代理;作为unix命令运行作业

分享于 

4分钟阅读

GitHub

  繁體 雙語
beanstalkd broker; run jobs as unix commands.
  • 源代码名称:cmdstalk
  • 源代码网址:http://www.github.com/99designs/cmdstalk
  • cmdstalk源代码文档
  • cmdstalk源代码下载
  • Git URL:
    git://www.github.com/99designs/cmdstalk.git
    Git Clone代码到本地:
    git clone http://www.github.com/99designs/cmdstalk
    Subversion代码到本地:
    $ svn co --depth empty http://www.github.com/99designs/cmdstalk
    Checked out revision 1.
    $ cd repo
    $ svn up trunk
    
    cmdstalk

    Cmdstalk是一个 unix-process-based beanstalkd 队列代理。

    编写 go cmdstalk使用 kr/beanstalk库与beanstalkd队列守护进程进行交互。

    每个作业作为stdin传递到已经配置的worker命令的新实例。 在 exit(0) 上删除作业。 在 exit(1) ( 或者任何非零状态) 上,作业以指数退避延迟( releases^4 ) 释放,最高 10倍。

    工作完成后,员工未完成作业,员工被杀死,作业将被允许超时。 当作业随后被保留时,timeouts: 1 将导致它被隐藏。

    通过这种方式,作业worker可以是任意的命令,队列语义可以减少到退出状态和信号的基本unix概念。

    安装

    来源:

    # Make sure you have a sane $GOPATHgo get github.com/99designs/cmdstalk

    从二进制:

    https://github.com/99designs/cmdstalk/releases

    用法

    cmdstalk -help# Usage of./cmdstalk:# -address="127.0.0.1:11300": beanstalkd TCP address.# -all=false: Listen to all tubes, instead of -tubes=...# -cmd="": Command to run in worker.# -per-tube=1: Number of workers per tube.# -tubes=[default]: Comma separated list of tubes.# Watch three specific tubes.cmdstalk -cmd="/path/to/your/worker --your=flags --here" -tubes="one,two,three"# Watch all current and future tubes, four workers per tube.cmdstalk -all -cmd="cat" -per-tube=4

    插件开发

    gpm 用于跟踪依赖项。 确保你有一个理智的$GOPATH 等,然后 brew install gpmgpm install

    # Run all tests, with minimal/buffered output.go test./...# Run tests in the broker package with steaming output.(cd broker && go test -v)# Run cmdstalk from source.go run cmdstalk.go -cmd='hexdump -C' -tubes="default,another"# Build and run a binary.go build
    file cmdstalk # cmdstalk: Mach-O 64-bit executable x86_64

    版本

    # Set up cross-compiling tool.go get github.com/mitchellh/gox
    gox -build-toolchain -os="darwin linux" -arch="amd64"# Compile for various systems.gox -os="darwin linux" -arch="amd64"gzip cmdstalk_*_*# Create a release.open https://github.com/99designs/cmdstalk/releases/new

    待办事项

    • 正常关机。
    • SIGKILL recalcitrant工作进程。
    • 日志记录改进;stdout/stderr,并发安全。
    • 交互模式;单个并发,每个作业的操作提示。

    创建由 AnnesleyLachlan Donald。

    ©版权 2014 99designs 公司。


    COM  COMM  bro  Comma  bea  job  
    相关文章