Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

parallel processing fork manager inspired by Parallel::Prefork in CPAN

Project description

This module is inspired by Parallel::Prefork in CPAN.

As Parallel::Prefork, this module is intended to be some operations done in parallel.

Simple example of usage is followings

>>> from python_prefork import PythonPrefork
>>> pp = PythonPrefork()
>>> while not pp.signal_received:
>>>     if pp.start(): continue
>>>
>>>     run() # do some task in child process
>>>
>>>     pp.finish()
>>> pp.wait_all_children()
Some options can be set in constructor

[ max_workers ] maximum number of child processes to fork

[trap_signals] arrays of signals to be trapped. parent process will send these signals to all children

[on_reap_cb] function to be called when a child is end. This function must have two parameters, child pid and exit status.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python_prefork, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size python_prefork-0.1.2-py2.5.egg (11.1 kB) File type Egg Python version 2.5 Upload date Hashes View hashes
Filename, size python_prefork-0.1.2.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page