riot-lol-api | Small helper to handle Riot API rate limiting | REST library
kandi X-RAY | riot-lol-api Summary
kandi X-RAY | riot-lol-api Summary
This module lets you query the Riot API for LeagueOfLegends data. You'll need a developer key from This module was developed for people that need to poll the Riot API with a very high throughput (with peaks above the standard production rate limit of 300 calls / second / region). If you don't need this kind of performance, you'll probably be better with other modules -- have a look at lol-js for instance :).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of riot-lol-api
riot-lol-api Key Features
riot-lol-api Examples and Code Snippets
Community Discussions
Trending Discussions on riot-lol-api
QUESTION
QUESTION:
After reading this:
https://www.npmjs.com/package/riot-lol-api#caching
I am still confused. This is my first time trying to cache api responses.
For example, I do not know what values are available for YOUR_CACHE_STRATEGY
and it is not explained in the docs.
Essentially, I would be looking for an example, like how can I cache and serve for 5 min the response from /lol/summoner/v3/summoners/by-name/
?
CODE:
...ANSWER
Answered 2018-Nov-10 at 20:49The documentation is not very detailed indeed. What you need to do is basically implement the cache object as specified in the code sample from the doc (the commented area).
Below is an example of caching to an array (in memory). You could also save this array to a file or into a Redis database as suggested in the doc.
QUESTION
SITUATION:
I had an existing codebase that used another library to make requests to the Riot API. Sadly, said library had some issues, so I decided to switch to this one:
https://www.npmjs.com/package/riot-lol-api
https://github.com/Neamar/riot-lol-api/blob/master/lib/index.js
Only issue: this library does not seem to use Promises while the old one did and I have a hard time adapting my code to this new library.
CODE:
...ANSWER
Answered 2018-Nov-05 at 11:06When I wrote the library, promises were really slow. Using promises allowed me to send 700 requests per second per CPU, without promises I got to 1000 requests per seconds per CPU.
If performance is not an issue in your case, you can transform the callback style functions to promises using this small wrapper:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install riot-lol-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page