No project description provided
Project description
multifutures
A library that simplifies using multithreading/multiprocessing pools
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
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
multifutures-0.3.1.tar.gz
(8.2 kB
view details)
Built Distribution
File details
Details for the file multifutures-0.3.1.tar.gz
.
File metadata
- Download URL: multifutures-0.3.1.tar.gz
- Upload date:
- Size: 8.2 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | eadf4325d736523b7581a9260dc1c8b8d55a87ea95f00b7febb49503a74d7ed6 |
|
MD5 | 6354670ca2c049b038fa862c749e64af |
|
BLAKE2b-256 | c482af1393188b6a4dfbc1605fb5be49e97ef6029ce2ea562088eee8b23b5dce |
Provenance
File details
Details for the file multifutures-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: multifutures-0.3.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f84aefca3917ca1d790ca47ba2a1d89564c2ed5498aebfb8371aa223f8aebb1b |
|
MD5 | 3fe0dd2765d2f83474c10932e07c6fdb |
|
BLAKE2b-256 | 7ebcdc8cf3ee7b7c3195c50fc7c5e81bdca938a5624eeaa7ba5ba1722cd23b98 |