Ejemplo n.º 1
0
def serial_main(daemon_mode):
    cache = CorgiCache()

    while True:
        feeds = cache.get_all_feeds()

        for feed in feeds:
            scrap_feed(feed)

        if not daemon_mode:
            break
    return
Ejemplo n.º 2
0
def async_main(daemon_mode):
    pool = Pool()
    cache = CorgiCache()

    while True:
        feeds = cache.get_all_feeds()

        for feed in feeds:
            pool.apply_async(func=scrap_feed, args=feed)

        pool.close()
        pool.join()

        if not daemon_mode:
            break
    return