def multithread_request(urls, config=None):
 config = (config or Configuration())
 num_threads = config.number_threads
 timeout = config.thread_timeout_seconds
 pool = ThreadPool(num_threads, timeout)
 m_requests = []
 for url in urls:
  m_requests.append(MRequest(url, config))
 for req in m_requests:
  pool.add_task(req.send)
 pool.wait_completion()
 return m_requests

def multithread_request ( urls , config = None ) : config = ( config or Configuration ( ) ) num_threads = config . number_threads timeout = config . thread_timeout_seconds pool = ThreadPool ( num_threads , timeout ) m_requests = [ ] for url in urls : m_requests . append ( MRequest ( url , config ) ) for req in m_requests : pool . add_task ( req . send ) pool . wait_completion ( ) return m_requests
request multiple urls via mthreading .