2020-06-20 19:03:12 -07:00
2020-06-20 19:01:39 -07:00
2020-06-20 16:55:48 -07:00

Go-Do

Implement a simple way to "toss" a job to be run in parallel with your main application logic and when you're ready to use the results of that job query if it's finished.

Example:

from go_do import Do

## From a docker hub api bit of code.

def get_all(url):
    "Retrieve all paged results"
    rsp = urllib.request.urlopen(url)
    while 200 <= int(rsp.getcode()) < 300:
    	data = json.loads(rsp.read())
	url = data.get("next")
	next = Do(urllib.request.urlopen, url) if url else None
	for item in data['results']:
	    yield item
	if next is None:
	    break
	# If the result is not ready yet, wait for it.
	rsp = next.wait_for_it()
    print("Done")
Description
No description provided
Readme 25 KiB
Languages
Python 74.2%
Makefile 25.8%