コード例 #1
0
ファイル: publish.py プロジェクト: huyunzhen/browsercast
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])
コード例 #2
0
ファイル: publish.py プロジェクト: huyunzhen/browsercast
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])
コード例 #3
0
ファイル: mail.py プロジェクト: pentikousis/C-BAS-framework
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,
    )