boxysean / pylateral

Intuitive multi-threaded task processing in python.

Home Page:https://boxysean.github.io/pylateral/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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!")

About

Intuitive multi-threaded task processing in python.

https://boxysean.github.io/pylateral/

License:MIT License


Languages

Language:HTML 96.5%Language:JavaScript 2.6%Language:CSS 0.9%