'Python: Threads are skippig post api calls, concurrent futures threading, why?

def trader(symbol):
    <trader code>

#run trader for each symbol

def whilefor():
    while True:
        for symbol in symbols:
            trader(symbol)

#use concurent futures to run trader function for each symbol using many threads
def run():
    while True:
        with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor:
                executor.map(trader, [symbol for symbol in symbols])

i am just trying to run the same whilefor function using multiple threads, why is it that the run() function skips some post api calls while the whilefor() function does not ?



Solution 1:[1]

turns out my trader function had an error and u can not see errors by default if they happen while multi processing

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 krowxx