Skip to main content

Intuitive multi-threaded task processing in python.

Project description

pylateral

Intuitive multi-threaded task processing in python.

Example

import urllib.request

@pylateral.task
def request_and_print(url):
    response = urllib.request.urlopen(url)
    print(response.read())

URLS = [
    "https://www.nytimes.com/",
    "https://www.cnn.com/",
    "https://europe.wsj.com/",
    "https://www.bbc.co.uk/",
    "https://some-made-up-domain.com/",
]

with pylateral.task_pool():
    for url in URLS:
        request_and_print(url)

print("Complete!")

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

pylateral-1.0.0.tar.gz (8.3 kB view hashes)

Uploaded Source

Built Distribution

pylateral-1.0.0-py3-none-any.whl (12.4 kB view hashes)

Uploaded Python 3

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