from loguru import logger from stock_downloader import stock_download from multiprocessing.pool import Pool from redis import Redis from rq import Queue stock_symbols = ['AAPL', 'NVDA', 'MSFT', 'JNJ'] logger.remove() logger.add('/tmp/stock_downloader.log') def main(): q = Queue(connection=Redis(host='localhost', port=6379)) for symbol in stock_symbols: q.enqueue(stock_download, symbol) if __name__ == '__main__': main()