Skip to main content

Multiprocessing/multithreading made easy

Project description

multifutures

PyPI - Version PyPI - Python Version ci

Multiprocessing/multithreading made easy!


Table of Contents

Installation

python -mpip install multifutures

Usage

import multifutures as mf


def return_square(number: float) -> float:
    squared = number**2
    return squared


results = mf.multiprocess(
    func=return_square,
    func_kwargs=[{"number": i} for i in range(10)],
)

for result in results:
    print(result)

Will print:

FutureResult(exception=None, kwargs={'number': 0}, result=0)
FutureResult(exception=None, kwargs={'number': 1}, result=1)
FutureResult(exception=None, kwargs={'number': 2}, result=4)
FutureResult(exception=None, kwargs={'number': 3}, result=9)
FutureResult(exception=None, kwargs={'number': 4}, result=16)
FutureResult(exception=None, kwargs={'number': 5}, result=25)
FutureResult(exception=None, kwargs={'number': 6}, result=36)
FutureResult(exception=None, kwargs={'number': 7}, result=49)
FutureResult(exception=None, kwargs={'number': 8}, result=64)
FutureResult(exception=None, kwargs={'number': 9}, result=81)

License

multifutures is distributed under the terms of the MIT license.

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

multifutures-0.3.2.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

multifutures-0.3.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file multifutures-0.3.2.tar.gz.

File metadata

  • Download URL: multifutures-0.3.2.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.2-arch2-1

File hashes

Hashes for multifutures-0.3.2.tar.gz
Algorithm Hash digest
SHA256 bd3745c42c9424b8c7001d0a9c358df217f29531a5517532cdcba3b4e5590beb
MD5 0091ee90b812f8eddd0485de102166b7
BLAKE2b-256 b7a981a35cc4c08e9c4b9de31dd803208376481bac4dcb18672aeb7ea55f4992

See more details on using hashes here.

File details

Details for the file multifutures-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: multifutures-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.2-arch2-1

File hashes

Hashes for multifutures-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ab88743d9734df949c58a97342ebeafacb4a933ebba3a57d67f69223a3b31d7
MD5 96027ff2509e146920666a7736fbfa73
BLAKE2b-256 499448fd3e3a22d29dede9f79a19c78a39555679f4a50dd4b2a07fefc61623fa

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