From af7b3997ed0b437348f3d1d0cb76d7e091a4cbed Mon Sep 17 00:00:00 2001 From: VG Date: Mon, 25 Apr 2016 17:37:08 +0200 Subject: Implement the teaqueue project. - readme has been completed. - teaqueue-server has been implemented. - teaqueue-client has been implemented. - some worker examples have been written. --- teaqueue-client | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 teaqueue-client (limited to 'teaqueue-client') diff --git a/teaqueue-client b/teaqueue-client new file mode 100755 index 0000000..c52d01e --- /dev/null +++ b/teaqueue-client @@ -0,0 +1,47 @@ +#!/bin/sh + +set -eu + +# default options +host="127.0.0.1" +port=1340 +retry_timeout=10 + +usage() +{ + cat <&2; exit 1; fi +eval set -- "$TEMP" +while true; do + case "$1" in + -h|--help) usage; exit 0;; + -H|--host) host="$2"; shift 2;; + -p|--port) port="$2"; shift 2;; + --) shift; break;; + *) echo "Arguments parsing error" >&2; exit 1;; + esac +done + +if test $# -lt 1; then + echo "You must put a command to call" >&2; exit 1 +fi + +set +e + +while true; do + while ! nc -q0 "$host" "$port"; do sleep $retry_timeout; done | "$@" + sleep 1 +done -- cgit v1.2.3