Skip to main content

Multiprocess Framework for Server and Mobiles; run your generator output and server on every CPU core,

Project description

https://github.com/44xtc44/eisenmp/actions/workflows/tests.yml/badge.svg

Python 3.7

Multiprocessor Framework for single Server

Kwargs To Go

Features:

  • Uniform foundation to create multiprocess project modules

  • Workload Chunks with header to control output and speed up a specific task

  • Chunks get a serial number (ID), findings can be checked in a result dictionary, which ID is missing

  • module_loader decouples your Worker imports from Main()

  • Categories of Queues, assign Names to Queues and groups of Queues

  • Queue list helps to debug your setup and reveals the name, object id and object reference of every Queue

  • Print Queue allows formatted print to screen for your processes (blocks)

  • No libraries, (Linux, Windows)

Visit the features above in the Examples gitHub repository
or

download the all inclusive PyPi Examples package and execute eisenmp_url in Terminal to start the simpleHTTP Ajax server

All scenarios run on Template Style Modules. Enjoy the descriptions.

How it works

You write two functions and two modules. Let’s name them Manager.py and Worker.py.

  1. Manager.py defines custom objects and starts a new process, target is module_loader.py (loader)

  2. loader imports your (independent) Worker.py module from file system without side effects

  3. loader sits in a loop and calls your Worker.py entry function until queue is empty

  4. q_feeder iterator sends a STOP message. Your Worker reads STOP, return False and exit.

  5. module_loader module then puts a STOP Worker message in all other input queues.

  6. Next Worker reads STOP, exit …

  7. Loader runs idle and awaits the internal STOP Process message.

Worker module loader, loads independent, no imports of parent

Generators

Generator, iterator, lists with name and ID header

Variables transfer to worker

The worker should be more flexible. Thus, it needs more structured information.

  • Information collector is the ModuleConfiguration class instance. The class can carry any name.

  • All instance attributes are stored in a dictionary __dict__. (self.foo will be kwargs.foo)

  • The instance dictionary is argument (kwargs) to call the eisenmp start method.

  • Kwargs is updated further with queue information and the START_SEQUENCE_NUM of the process, before process start.

Generator, Iterator makes lists, result in dictionary

Default Queues

  • Input worker lists, Output result and stop lists

  • Tools, Print, Info

How to run the examples?

Fast PyPi package. eisenmp will be installed also.

In depth. Clone both repos.

eisenmp and eisenmp_examples

Install in editable pip mode.

cd eisenmp
pip3 install -e .  # uninstall (linux pip3) with: pip3 uninstall eisenmp

cd eisenmp_examples
pip3 install -e .  # uninstall with: pip3 uninstall eisenmp_examples

Run the examples. Either local Ajax Web server or terminal menu.

eisenmp_url
# or
eisenmp_menu

Get the documentation on readthedocs https://eisenmp.readthedocs.io/

Project details


Download files

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

Source Distribution

eisenmp-1.0.tar.gz (70.5 kB view details)

Uploaded Source

Built Distribution

eisenmp-1.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file eisenmp-1.0.tar.gz.

File metadata

  • Download URL: eisenmp-1.0.tar.gz
  • Upload date:
  • Size: 70.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for eisenmp-1.0.tar.gz
Algorithm Hash digest
SHA256 31958d317c1181c71c5ca1dc9941e1eee7f36bcccec58864dec2794a3d459ad9
MD5 526a3f7a6835bdf282c431013284d5de
BLAKE2b-256 7ea042972aa575624687736cae5f7a3970b61786074f53af49cf679f73ff4fb7

See more details on using hashes here.

File details

Details for the file eisenmp-1.0-py3-none-any.whl.

File metadata

  • Download URL: eisenmp-1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3

File hashes

Hashes for eisenmp-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ac2f9939af14be51bea6f333a90ebd6630e814212f2a7ea3163484ae58ee521
MD5 2b7c8cee66edbc30d7af7d99809dbf8a
BLAKE2b-256 8d37fec4bb07dd013cdb22e137aabd2b853bdbb94917d50ec868934cb4e6daf7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page