Samo Penic
2018-06-25 c0d5bcca06dcb6b7e3b570b739a5685d59f4ab04
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)