antirez / antirez/disque

UNIX-ey command line interface for Disque

未关闭
#147 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C
星标
8.1k
派生
532
PR 合并指标
30 天内没有已合并 PR

描述

Current command line client looks a bit like `whateversql` CLI tool: suitable for management and debugging, but not very suitable to implement Discue-facing services in Bash or in general using command line world.

Is there already a client that starts a script for each job and acknowledges it when script exits successfully?

Job data can be fed to stdin, queue name and job id can be command line parameters.

I expect something like this:

```
$ cat > myscript <<\EOF
#!/bin/sh
# $1 and $2 are parameters specified in the disque-spawner
echo "Serving a job $3 from queue $4" >&2
sleep 5 # pretend to be working hard[ly]
wc
EOF
$ chmod +x myscript
$ disque-spawner -h queue1 queue2 ... queueN --execute ./myscript script_parameter1 script_parameter2 &
$ disque-post -h --wait queue2 < myfile.txt
D-e09bb425-Ht6sbFnDQ5jbmxELCwJAgHKU-05a1
$
```

`disque-spawner` should start specified command for each incoming job. It should periodically do `WORKING` if the comand is working, `ACKJOB` if command is finished with exit status 0 and `NACK` if finished with exit status not 0.

If not, where should such be implemented:
- As a separate project, like for language bindings
- As separate command line tools inside this repository
- As a special mode for usual `disque-cli.c`?

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。