Skip to main content

Serving with asyncio, multiprocessing, and batching

Project description

mpservice

Utilities for Python concurrency, including

  • Serving with multiprocessing to make full use of multiple cores, and batching to take advantage of vectorized computation if some components of the service have that capability.

    One use case is machine learning model serving, although the code is generic and not restricted to this particular use case.

  • Stream processing, i.e. processing a long, possibly infinite stream of input data, with multiple operators in the pipeline. A main use case if that one or more of the operators is I/O bound (think: calling an external service), hence can benefit from concurrency. Both sync and async interfaces are provided.

The serving and streaming utilities can be combined because a mpservice.mpserver.MPServer instance, while doing heavy-lifting in other processes, acts as an I/O bound operator in the main process. Indeed, mpservice.mpserver.MPServer provides methods stream and async_stream for using the server to process data streams.

The package also contains some other related utilities.

To install, do pip install mpservice.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

mpservice-0.9.1.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mpservice-0.9.1-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file mpservice-0.9.1.tar.gz.

File metadata

  • Download URL: mpservice-0.9.1.tar.gz
  • Upload date:
  • Size: 22.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for mpservice-0.9.1.tar.gz
Algorithm Hash digest
SHA256 e54085ffe87428e42a23a11b94c3a04403617199a0f29bcbadad244131d2ac5c
MD5 00fb94dfc01b35bc1bd043088639a2fd
BLAKE2b-256 a97b759b8d4346829aab28bc9bad075a203d811df0a99b81b0036c5e0f17ac18

See more details on using hashes here.

File details

Details for the file mpservice-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: mpservice-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5

File hashes

Hashes for mpservice-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 165018ed133700af1709f365022f9322ce499c0138dece1a3f1f750352b33a68
MD5 094ecc6d822bacb9411f3ce50f513689
BLAKE2b-256 d0c6c8152129dfefe3b74a212d84725a1390d66d4c79051c2b47dd078dc11d8c

See more details on using hashes here.

Supported by

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