You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get started (this will become part of the docs soon):
constsymbols=['TSLA','MSFT','AAPL'];// Will perform one request at a time, one after the otherconstdata=[];for(letsymbolofsymbols)data.push(awaityahooFinance.quoteSummary(symbol));// Will perform all requests simultaneously (not great for > ~8 symbols)constdata=Promise.all(symbols.map(symbol=>yahooFinance.quoteSummary(symbol)));
Both approaches return an identical result, the only different is that the 2nd method performs all requests at the same time.
You can use something like p-limit to limit the number of simultaneous requests to something like 8 or whatever is appropriate for your network. I'm currently working on baking this in with #76, so you can watch that space. That will make it easier to limit the total concurrent calls across different functions or callbacks, which has the same convenience of quoteCombine - even though it will still be with multiple network requests. You can do it already without a limit but you might choke your connection if you do it with too many requests simultaneously.
Hope that all makes sense and let me know if you have any more questions. The code above is not tested but should be good 😅
The text was updated successfully, but these errors were encountered:
Originally posted by @gadicc in #114 (comment)
To get started (this will become part of the docs soon):
Both approaches return an identical result, the only different is that the 2nd method performs all requests at the same time.
You can use something like p-limit to limit the number of simultaneous requests to something like 8 or whatever is appropriate for your network. I'm currently working on baking this in with #76, so you can watch that space. That will make it easier to limit the total concurrent calls across different functions or callbacks, which has the same convenience of
quoteCombine
- even though it will still be with multiple network requests. You can do it already without a limit but you might choke your connection if you do it with too many requests simultaneously.Hope that all makes sense and let me know if you have any more questions. The code above is not tested but should be good 😅
The text was updated successfully, but these errors were encountered: