Background
It runs stuff in the background.
“An elegant decorator-based abstraction around Python 3’s concurrent.futures ThreadPoolExecutor class”
—Simon Willison
This module makes it stupidly simple to run things in the background of your application, be it a CLI app, or a web app.
Basic Usage
import time
import background
@background.task
def work():
# Do something expensive here.
time.sleep(10)
for _ in range(100):
work()
Advanced Usage
import time
import background
# Use 40 background threads.
background.n = 40
@background.task
def work():
time.sleep(10)
return "Done!"
@background.callback
def work_callback(future):
print(future.result())
for _ in range(100):
work()
Installation
$ pipenv install background ✨🍰✨
Metadata
Release files for background 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| background-0.2.1.tar.gz | 3.1 kB | Without provenance | Details for background-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| background-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for background-0.2.1-py3-none-any.whl |
Total release size: 5.3 kB
Release files / background-0.2.1.tar.gz
| Download URL | background-0.2.1.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a5ed40b4a2a9f3340b1402862725d35016dc2490f95d89a2de47c3ddf215b91
|
|
BLAKE2b-256 checksum How to use checksums |
b141d6122c8e4bb280b2182098d77554d00016b6ffe54201cd3fac7f52fe9df2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Release files / background-0.2.1-py3-none-any.whl
| Download URL | background-0.2.1-py3-none-any.whl |
|---|---|
| Size | 2.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c230e2813c773f93ecae54281ce6b1b425c895c24599cc203b7f137e4d7c4802
|
|
BLAKE2b-256 checksum How to use checksums |
c74501a33c692ce9f22214cad440f34704ed74e56b6f21d90e71aa595b3c2b72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Security for background 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.