How to build a streaming API client?

I’m interested in building an API client for the Hacker News API, and I’d like to add supper for live data in the form of the Stream module.

I’m still starting my Elixir journey so I’m not quite sure how to achieve this. Any pointers?

1 Like

Seems to me that what you want to do is use Phoenix, create a channel, then broadcast news to that channel when you have it to provide. Any clients that are attached to the channel could then get a live feed.

Check out this post for a similar use case involving twitter.

Turns out that if I ask Firebase for an EventSource stream I can sorta get it working (just tried in iex). I think GenStage might be a good fit, thanks.

For example, open this and wait a bit. You should get new stuff posted!