Example #1
0
'''
Created on Jan 24, 2019
@author: GANESHRAM KANAKASABAI
'''

from time import sleep  # importing sleep function to set delay
from labs.module03.TempSensorAdaptor import TempSensorAdaptor  # importing TempSensorEmulator Class to measure temperature
'''
 Creating a new object to measure temperature and monitor
'''
sensor_data = TempSensorAdaptor("Temperature Data")
'''
When the program quits,any daemon threads are killed automatically
'''
sensor_data.daemon = True
sensor_data.start()
#starting the activity of thread

while True:
    sleep(1)
    # The sleep() suspends the execution for the fixed number of seconds.
    pass
Example #2
0
'''
Created on Oct 12, 2018

@author: l0t0y
'''

from labs.module03.TempSensorAdaptor import TempSensorAdaptor
from asyncio.tasks import sleep

TSA = TempSensorAdaptor()
TSA.daemon = True
print("Daemon Thread Starting...")
TSA.start()

while (True):
    sleep(5)
    pass
Example #3
0
'''
Created on Sep 27, 2019

@author: cytang
'''
from labs.module03.TempSensorAdaptor import TempSensorAdaptor
import logging

logging.basicConfig(format='%(asctime)s:%(levelname)s:%(message)s',
                    level=logging.INFO)
logging.info("Module03 app start")
temp = TempSensorAdaptor()
#temp.daemon=True
temp.start()
#temp.run()