-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-streaming-samples.sh
More file actions
executable file
·60 lines (46 loc) · 1.65 KB
/
run-streaming-samples.sh
File metadata and controls
executable file
·60 lines (46 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Aeron Cache Embedded - Parallel Streaming Sample Runner
# This script runs all streaming samples in parallel and stops them together.
# Setup environment
WORKSPACE_ROOT=$(pwd)
export PYTHONPATH=$PYTHONPATH:$WORKSPACE_ROOT/libraries/python
# Colors for output
BLUE='\033[0;34m'
NC='\033[0m' # No Color
echo -e "${BLUE}>>> Starting Parallel Streaming Sample Run...${NC}"
# PIDs to keep track of processes
PIDS=()
# Cleanup function on EXIT
cleanup() {
echo -e "\n${BLUE}>>> Stopping all samples...${NC}"
for pid in "${PIDS[@]}"; do
if kill -0 "$pid" 2>/dev/null; then
kill "$pid" 2>/dev/null
fi
done
wait 2>/dev/null
echo -e "${BLUE}>>> All samples stopped.${NC}"
exit 0
}
trap cleanup EXIT INT TERM
# Prepare
(cd samples/typescript/streaming-sample && npm install --quiet && npm run build --quiet)
# 1. Java
echo -e "${BLUE}Starting Java Streaming Sample...${NC}"
(cd samples/java/streaming-sample && ./gradlew run --quiet) &
PIDS+=($!)
# 2. Python
echo -e "${BLUE}Starting Python Streaming Sample...${NC}"
(cd samples/python/streaming-sample && /usr/bin/python3 streaming_sample.py http://localhost:7070 ws://localhost:7071) &
PIDS+=($!)
# 3. TypeScript
echo -e "${BLUE}Starting TypeScript Streaming Sample...${NC}"
(cd samples/typescript/streaming-sample && node dist/index.js http://localhost:7070 ws://localhost:7071) &
PIDS+=($!)
# 4. Rust
echo -e "${BLUE}Starting Rust Streaming Sample...${NC}"
(cd samples/rust/streaming-sample && cargo run --quiet -- http://localhost:7070 ws://localhost:7071) &
PIDS+=($!)
echo -e "${BLUE}>>> All samples are running. Press Ctrl+C to stop.${NC}"
# Wait for children
wait