commit | author | age
|
59a59b
|
1 |
#!/usr/bin/python3 |
SP |
2 |
from tsclient import * |
|
3 |
import signal |
|
4 |
|
|
5 |
#--- SIGINT and SIGTERM HANDLING --- |
|
6 |
def signal_handler(signal,frame): |
|
7 |
t.stop() |
|
8 |
t.join() |
|
9 |
print("Process ended with signal " +str(signal)) |
|
10 |
sys.exit(signal) |
|
11 |
#--- END SIGINT and SIGTERM---- |
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
signal.signal(signal.SIGINT, signal_handler) |
|
16 |
signal.signal(signal.SIGTERM, signal_handler) |
|
17 |
|
|
18 |
t=ClientThread(conn_address='http://localhost:8000',update_seconds=100) |
|
19 |
t.start() |
|
20 |
#t.join() |
|
21 |
#print("main") |
|
22 |
while(True): |
|
23 |
sleep(1000) |