Metadata-Version: 2.1
Name: mpservice
Version: 0.10.8
Summary: Serving with asyncio, multiprocessing, and batching
Author-email: Zepu Zhang <zepu.zhang@gmail.com>
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: overrides
Requires-Dist: psutil
Requires-Dist: uvicorn[standard] >=0.15.0,<1.0
Requires-Dist: uvloop
Requires-Dist: faster-fifo >=1.3.1,<1.4.0 ; extra == "faster-fifo"
Requires-Dist: bandit ; extra == "test"
Requires-Dist: coverage[toml] ; extra == "test"
Requires-Dist: Faker ; extra == "test"
Requires-Dist: flake8 ; extra == "test"
Requires-Dist: httpx ; extra == "test"
Requires-Dist: locust ; extra == "test"
Requires-Dist: mypy ; extra == "test"
Requires-Dist: pylint ; extra == "test"
Requires-Dist: pytest ; extra == "test"
Requires-Dist: pytest-asyncio ; extra == "test"
Requires-Dist: requests ; extra == "test"
Requires-Dist: starlette ; extra == "test"
Requires-Dist: zpz[lineprofiler] ; extra == "test"
Project-URL: Source, https://github.com/zpz/mpservice
Provides-Extra: faster-fifo
Provides-Extra: test

# 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
  is that one or more of the operators is I/O bound (think: calling an external
  service), hence can benefit from concurrency.

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 method `stream`
for using the server to process data streams.

A `MPServer` object could be used either in "embedded" mode or to back a service.
Utilities are provided in `mpservice.http` and `mpservice.socket` for the latter use case.

The package also contains some other related utilities.

To install, do `pip install mpservice`.

