Closed Omidgholi closed 1 year ago
DeprecationWarning: There is no current event loop: loop = asyncio.get_event_loop()
DeprecationWarning: There is no current event loop: group1 = asyncio.gather(*tasks)
Taken from the provided example code
import asyncio from alpha_vantage.async_support.timeseries import TimeSeries symbols = ['AAPL', 'GOOG', 'TSLA', 'MSFT'] async def get_data(symbol): ts = TimeSeries(key="KZ2BLSHOXOXZRU4V") data, _ = await ts.get_quote_endpoint(symbol) await ts.close() return data loop = asyncio.get_event_loop() tasks = [get_data(symbol) for symbol in symbols] group1 = asyncio.gather(*tasks) results = loop.run_until_complete(group1) loop.close() print(results)
Closing for now. Will reopen if there is further community response. Thanks!
DeprecationWarning: There is no current event loop: loop = asyncio.get_event_loop()
DeprecationWarning: There is no current event loop: group1 = asyncio.gather(*tasks)
Taken from the provided example code