_This article was recently featured in Elixir Radar. Since it was written, I’ve found a simpler way to implement this kind of Stream. I’ll be writing an updated tutorial in the future, but if you’re interested, you should also check out the current state of ExTwilio.ResultStream._
Twilio paginates its “list” APIs, requiring multiple requests to fetch all of a given resource. However, users of my API library will expect to be able to fetch all of a resource and perform operations on it, like this:
calls = ExTwilio.Call.all Enum.each calls, fn(call) -> # perform some operation end
Users won’t want to mess with the details of pagination. They want to get a collection containing everything and then operate on it.
I find that there are two basic ways to achieve this, a blocking way and a non-blocking way.[Read More]