How should I fetch multiple URLs from within a method in a Circuits framework Controller in Python 3? Here's a trivial example of what I want except with urllib3. It would be preferable to request both URLs at the beginning and when they both are back, continue execution.
# -*- coding: utf-8 -*-
__author__ = 'jscarbor'
import urllib3
from circuits.web import Server, Controller, Static
http = urllib3.PoolManager()
class Root(Controller):
def index(self):
self.response.headers["Content-Type"] = "text/plain"
a = http.request('GET', 'https://www.w3.org/services/html2txt?url=http%3A%2F%2Fwww.example.com%2F').data
b = http.request('GET', 'http://home.hiwaay.net/~jimes/checklist.txt').data
return "%s %s" % (a, b)
(Server(8011) + Root()).run()