Python multiprocess.Process() Examples

The following are 5 code examples of multiprocess.Process(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module multiprocess , or try the search function .
Example #1
Source File: rollouts.py    From rl-teacher with MIT License 5 votes vote down vote up
def __init__(self, task_q, result_q, env_id, make_env, seed, max_timesteps_per_episode):
        multiprocess.Process.__init__(self)
        self.env_id = env_id
        self.make_env = make_env
        self.seed = seed
        self.task_q = task_q
        self.result_q = result_q

        self.max_timesteps_per_episode = max_timesteps_per_episode

    # TODO Cleanup 
Example #2
Source File: test_subscription_transport.py    From graphql-python-subscriptions with MIT License 5 votes vote down vote up
def server(sub_mgr, schema, on_sub_mock):

    options, q = on_sub_mock
    app = create_app(sub_mgr, schema, options)

    process = multiprocess.Process(
        target=app_worker, kwargs={'app': app,
                                   'port': TEST_PORT})
    process.start()
    yield q
    process.terminate() 
Example #3
Source File: test_subscription_transport.py    From graphql-python-subscriptions with MIT License 5 votes vote down vote up
def server_with_mocks(sub_mgr, schema, options_mocks):

    options, q = options_mocks
    app = create_app(sub_mgr, schema, options)

    process = multiprocess.Process(
        target=app_worker, kwargs={'app': app,
                                   'port': TEST_PORT})

    process.start()
    yield q
    process.terminate() 
Example #4
Source File: test_subscription_transport.py    From graphql-python-subscriptions with MIT License 5 votes vote down vote up
def server_with_on_sub_handler(sub_mgr, schema, on_sub_handler):

    app = create_app(sub_mgr, schema, on_sub_handler)

    process = multiprocess.Process(
        target=app_worker, kwargs={'app': app,
                                   'port': TEST_PORT})
    process.start()
    yield
    process.terminate() 
Example #5
Source File: test_subscription_transport.py    From graphql-python-subscriptions with MIT License 5 votes vote down vote up
def server_with_keep_alive(sub_mgr, schema):

    app = create_app(sub_mgr, schema, {'keep_alive': .250})

    process = multiprocess.Process(
        target=app_worker, kwargs={'app': app,
                                   'port': TEST_PORT})
    process.start()
    yield
    process.terminate()