logos-messaging-test-query/sh/publish_multiple_clients.sh
2023-08-22 13:04:39 +02:00

19 lines
418 B
Bash

#!/bin/bash
## This script allows to publish multiple messages from multiple processes.
## Params
## $1 - The first parameter passed represents the number of clients.
## $2 - The second parameter has the # of messages each client will publish.
for i in $(seq $1); do
bash sh/publish_one_client.sh $2 &
pids[${i}]=$!
done
# wait for all pids
for pid in ${pids[*]}; do
echo Waiting for ${pid}
wait $pid
done