Python tornado.options.options 模块,processes() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用tornado.options.options.processes()

项目:auth-srv    作者:openpermissions    | 项目源码 | 文件源码
def main():
    """
    The entry point for the Authentication service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python auth --logging=DEBUG
            + python auth --logging=debug

        Configure custom syslog server:
            + python auth --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS)
    server = koi.make_server(app, CONF_DIR)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()
项目:query-srv    作者:openpermissions    | 项目源码 | 文件源码
def main():
    """
    The entry point for the Query service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python query --logging=DEBUG
            + python query --logging=debug

        Configure custom syslog server:
            + python query --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS)
    server = koi.make_server(app)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()
项目:resolution-srv    作者:openpermissions    | 项目源码 | 文件源码
def main():
    """
    The entry point for the resolution service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python resolution --logging=DEBUG
            + python resolution --logging=debug

        Configure custom syslog server:
            + python resolution --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = make_application()
    server = koi.make_server(app, CONF_DIR)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()
项目:accounts-srv    作者:openpermissions    | 项目源码 | 文件源码
def main():
    """
    The entry point for the Accounts service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python accounts --logging=DEBUG
            + python accounts --logging=debug

        Configure custom syslog server:
            + python accounts --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS)

    configure_logging()
    server = koi.make_server(app)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))
    prepare_config(options)

    IOLoop.instance().start()
项目:onboarding-srv    作者:openpermissions    | 项目源码 | 文件源码
def main():
    """
    The entry point for the Onboarding service.
    This will load the configuration files and start a Tornado webservice
    with one or more sub processes.

    NOTES:
    tornado.options.parse_command_line(final=True)
    Allows you to run the service with custom options.

    Examples:
        Change the logging level to debug:
            + python template --logging=DEBUG
            + python template --logging=debug

        Configure custom syslog server:
            + python template --syslog_host=54.77.151.169
    """
    koi.load_config(CONF_DIR)
    app = koi.make_application(
        __version__,
        options.service_type,
        APPLICATION_URLS)
    server = koi.make_server(app)

    # Forks multiple sub-processes, one for each core
    server.start(int(options.processes))

    tornado.ioloop.IOLoop.instance().start()