Post

If you like a live scrolling list of Bluesky posts from around the world, here is something for you. I've just shipped an update to my open source ATProto Browser that shows a live feed of Bluesky posts from the firehose. Try it and let me know what you think! atproto-browser.haroldadmin.com

Jetstream's Web Socket API emits hundreds of updates every second -- enough to overwhelm the browser if not managed carefully. Unfortunately, there is no standard way to solve backpressure in Web Sockets on the browser. The feed solves this by using a Web Streams layer.

The pipeline roughly looks like this: Web Socket -> Readable Stream -> Transforms -> Writable Stream. This lets me use the built-in backpressure support in web streams, but I also sample incoming updates to keep things running smoothly.

0 reposts1 like

At the end of the pipeline is a Writable Stream, which is just fake wrapper around something that a React component can subscribe to. The Feed component takes care of buffering the latest posts in memory, and discards the rest. GC is great, isn't it?