19 lines
No EOL
517 B
Python
Executable file
19 lines
No EOL
517 B
Python
Executable file
#!/usr/bin/python
|
|
|
|
# Dummy script used as a stand-in for singal-cli which replies to any JSON
|
|
# request with a JSON that has the same ID.
|
|
|
|
import sys
|
|
import json
|
|
|
|
# Stress-testing incoming messages
|
|
for i in range(2000):
|
|
print(json.dumps({"method":"receive","params":{"envelope":{"source":"67a13c3e-8d29-2539-ce8e-41129c349d6d"},"data":i}}))
|
|
|
|
# Reply to incoming messages
|
|
for line in sys.stdin:
|
|
try:
|
|
data = json.loads(line.strip())
|
|
if 'id' in data: print(json.dumps({'id': data['id']}))
|
|
except:
|
|
print("ERROR") |