Exemplo n.º 1
0
def main():
    for t in topics:
        t = t.replace("'", '').replace(' ', '-').lower()
        url = '/featured/' + t
        Q.put(url)

    n_threads = 10
    if not jython:
        from gevent.pool import Pool as ThreadPoolExecutor

        pool = ThreadPoolExecutor()
        for i in range(n_threads):
            pool.spawn(worker)
        pool.join()
    else:
        import sys

        sys.setrecursionlimit(64)
        pool = []
        import threading

        for i in range(n_threads):
            t = threading.Thread(target=worker)
            t.start()
            pool.append(t)
        for t in pool:
            t.join()
    print('main quit')
Exemplo n.º 2
0
    return links


for t in topics:
    t = t.replace("'", '').replace(' ', '-').lower()
    url = 'https://player.fm/featured/%s' % t
    Q.put(url)

n_threads = 10
if not jython:
    from gevent.pool import Pool as ThreadPoolExecutor

    pool = ThreadPoolExecutor()
    for i in range(n_threads):
        pool.spawn(worker)
    pool.join()
else:
    import sys

    sys.setrecursionlimit(64)
    pool = []
    import threading

    for i in range(n_threads):
        t = threading.Thread(target=worker)
        t.start()
        pool.append(t)
    for t in pool:
        t.join()
print('main quit')