I'm trying to call the same function with different parameters in parallel using multiprocessing
module.
Here is example of my code:
from django.apps import AppConfig
class CurrencyRatesConfig(AppConfig):
name = 'currency_rates'
def ready(self):
import time
from multiprocessing import Process
import currency_rates.ws_get_rates
p1 = Process(currency_rates.ws_get_rates.get_rates('1m', 'tBTCUSD', 'BTC2USD'))
p1.start()
p2 = Process(currency_rates.ws_get_rates.get_rates('1m', 'tIOTUSD', 'IOT2USD'))
p2.start()
p1.join()
p2.join()
But it doesn't work. I see just p1's execution result.
NOTE: get_rates()
uses websocket
module.
Could somebody describe what is wrong?
Thanks.