-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunexample.sh
More file actions
executable file
·23 lines (11 loc) · 927 Bytes
/
runexample.sh
File metadata and controls
executable file
·23 lines (11 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
stack run &
sleep 2
gnome-terminal -- /bin/sh -c 'wscat -c http://localhost:8080/subscribe_to_events -x "{ \"access_id\" : \"client1\", \"timestamp\" : 10 }" -w 240; sleep 10'
gnome-terminal -- /bin/sh -c 'wscat -c http://localhost:8080/subscribe_to_events -x "{ \"access_id\" : \"client2\", \"timestamp\" : 10 }" -w 240; sleep 10'
gnome-terminal -- /bin/sh -c 'wscat -c http://localhost:8080/subscribe_to_events -x "{ \"access_id\" : \"client3\", \"timestamp\" : 10 }" -w 240; sleep 10'
sleep 2
curl -H "Content-Type: application/json" -X POST -d '[{"accessid":"client1", "created_at": 30, "payload" : "client1 message"},{"accessid":"client2", "created_at": 20, "payload" : "client2 message"}]' localhost:8080/push_events
sleep 2
curl -H "Content-Type: application/json" -X POST -d '[{"accessid":"client3", "created_at": 30, "payload" : "client1 message"}]' localhost:8080/push_events
pkill notifier-exe