当前位置: 首页>>代码示例>>Python>>正文


Python Process.daemon方法代码示例

本文整理汇总了Python中multiprocessing.process.Process.daemon方法的典型用法代码示例。如果您正苦于以下问题:Python Process.daemon方法的具体用法?Python Process.daemon怎么用?Python Process.daemon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing.process.Process的用法示例。


在下文中一共展示了Process.daemon方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_litmus_with_authentication

# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import daemon [as 别名]
    def test_litmus_with_authentication(self):
        """Run litmus test suite on HTTP with authentification.

        This test passes
        """
        try:
            proc = Process(target=run_wsgidav_server, args=(True, False))
            proc.daemon = True
            proc.start()
            time.sleep(1)

            try:
                self.assertEqual(subprocess.call(["litmus", "http://127.0.0.1:8080/", "tester", "secret"]),
                                 0,
                                 "litmus suite failed: check the log")
            except OSError:
                print "*" * 70
                print "This test requires the litmus test suite."
                print "See http://www.webdav.org/neon/litmus/"
                print "*" * 70
                raise

        finally:
            proc.terminate()
            proc.join()
开发者ID:Nonolost,项目名称:wsgidav,代码行数:27,代码来源:test_litmus.py

示例2: process

# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import daemon [as 别名]
def process(host,port):
    from multiprocessing.process import Process
    
    p = Process(target=run, args=(host,port))  
    p.daemon = True
    p.start()     
    return p
开发者ID:robertbetts,项目名称:Kew,代码行数:9,代码来源:report_control.py

示例3: main

# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import daemon [as 别名]
def main():
    
    ''' parse the command line - new up the appl and listen on port '''
    if os.path.isfile("../kew_pe.conf"):
        print ("Loading config file ../kew_pe.conf")
        options.parse_config_file("../kew_pe.conf")
    options.parse_command_line()
        
    logging.basicConfig(level=logging.DEBUG)
    #report_control.process('localhost',8081)
    
    process = Process(target=report_control.run, name="report_control", kwargs={'host':'localhost', 'port':8081})
    process.daemon = True
    process.start()           
开发者ID:robertbetts,项目名称:Kew,代码行数:16,代码来源:test_run_report_control.py

示例4: start_actor_server

# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import daemon [as 别名]
def start_actor_server(
        actor,
        host_port_tuple=None,
        start_in_background_thread=False,
        log_requests=False,
        server_starter=start_bjoern_server
        ):
    if server_starter != start_bjoern_server:
        print("Using builtin server (slow)")

    if not host_port_tuple:
        # if no specific port is given,
        # run on free port
        host_port_tuple = ('', 0)

    port = host_port_tuple[1]
    if host_port_tuple[1] == 0:
        port = get_free_port(host_port_tuple)

    host_name = get_host_name(host_port_tuple[0])

    host_uri = 'http://{0}:{1}'.format(host_name, port)
    print("Running server on {0}".format(host_uri))

    wsgi_application = get_wsgi_application(
        actor, host_uri,
        log_requests=log_requests
    )

    if start_in_background_thread:
        process = Process(
            target=server_starter,
            args=(wsgi_application, host_name, port)
        )
        process.daemon = True
        process.start()
        return host_uri, process

    server_starter(wsgi_application, host_name, port)
开发者ID:dmr,项目名称:smart-grid-actor,代码行数:41,代码来源:server.py

示例5: build_process

# 需要导入模块: from multiprocessing.process import Process [as 别名]
# 或者: from multiprocessing.process.Process import daemon [as 别名]
def build_process(target):
    f51fp = Process(target=target, name=target.__name__)
    f51fp.daemon = 1
    f51fp.start()
    return f51fp
开发者ID:535521469,项目名称:crawl_free_ip_proxy,代码行数:7,代码来源:main.py


注:本文中的multiprocessing.process.Process.daemon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。