ws redis command improvements + test script
This commit is contained in:
25
ws/test_ws_redis.sh
Normal file
25
ws/test_ws_redis.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Handle Ctrl-C by killing all sub-processing AND exiting
|
||||
trap cleanup INT
|
||||
|
||||
function cleanup {
|
||||
kill `cat /tmp/pidfile.subscribe`
|
||||
exit 1
|
||||
}
|
||||
|
||||
REDIS_HOST=${REDIS_HOST:=localhost}
|
||||
|
||||
ws redis_subscribe --pidfile /tmp/pidfile.subscribe --host $REDIS_HOST foo &
|
||||
|
||||
# Wait for the subscriber to be ready
|
||||
sleep 0.5
|
||||
|
||||
# Now publish messages
|
||||
ws redis_publish -c 100000 --host ${REDIS_HOST} foo bar
|
||||
|
||||
# Wait a little for all messages to be received
|
||||
sleep 0.5
|
||||
|
||||
# Cleanup
|
||||
cleanup
|
Reference in New Issue
Block a user