def main(): logging.getLogger().setLevel(LOG_LEVEL) glib.threads_init() service_thread = ServiceThread('Television', 2015) logging.info('Starting service thread.') service_thread.start() waitForComplete([service_thread])
def send_mail(subject, message, from_email, recipient_list): """ Wrapper for the send_mail method within django.core.mail which uses a thread to decouple its execution from the main program. This is specially useful if mail server configuration is erroneus, server is very busy, etc; so normal flow will not be affected. """ ServiceThread.start_method_new_thread( django__send_mail, None, None, subject, message, from_email, recipient_list, )