swelham
GenStage examples or suggestions
I’m trying to put together a plan for a library that I am working on whereby I need to provide an interface that allows the client to asynchronously call out to external APIs (HTTP endpoints in this case). I also need to make sure that this is rate limited to adhere to the rate limiting on the externals APIs.
From what I have read GenStage sounds perfect for this and using a ConsumerSupervisor I would be able to dynamically start workers for each request as they come in and let GenStage limit the number of workers it will start concurrently.
Does anyone know of any good examples of this type of setup in practice?
I am trying to get my head around how this all fits together and feel a real world example would help me out here.
Most Liked
mechabyte
Discord published a blog post covering how they use genstage to buffer calls to Firebase APIs. It has some code examples as well as performance statistics.
swelham
yburyug
You can try my tutorial here or check out the Elixir School lesson







