A couple of days ago[0] I discovered WebSub and thought it was a very neat technology. After hearing some complaints about the existing providers (one incumbent and one legacy) I decided to make one with Elixir[1]! It's a pretty invisible service, but now many Wordpress users are using it to publish out updates to their blog, which is very neat. Let me know if you have any questions!
clone1018 It's nice to see more WebSub implementations out in the wild! I love the potential use cases of WebSub in enabling quick social feed polling in readers (potentially allowing near-real-time updates to show in combination with technologies like web sockets). Amazing to see an implementation in Elixir too!
Agreed! Websockets is one of my other hobbies and Elixir makes that a breeze too. Given another free weekend I'd like to see about minimizing some of the overhead of the Elixir implementation of WebSub just to make potential maintenance easy. Maybe DETS instead of a Postgres dependency :D?
Generally what happens is a a publisher lets you know its available via a list of WebSub Hubs. Then as a subscriber, your client will pick one or all hubs available and send a request to the hub to get notifications about any updates. The hub then double checks with the subscriber that they'd like to see these updates and that's it until the publisher submits an update. When the publisher has an update, they poke the Hub, the hub downloads the content and shoots it out to all of the subscribers.
For the publisher, it's as easy as including
Link: <https://hub.example.com/>; rel="hub"
or
<link rel="hub" href="https://hub.example.com/">
> For the publisher, it’s as easy as including [a link element or header] in the header of the content.
Well, you’ve got to poke the hub as well when changes occur, which makes it moderately incompatible with static site generation, requiring some kind of manual action after you publish, which could be comparatively straightforward if you use a site generator that allows you to define programmable post-publish hooks, or could be difficult if it doesn’t and you publish to something that doesn’t guarantee instant updates.
Never heard of WebSub before! Does this have some relevance to RSS and/or all those new hip "federated" decentralized sites? Or is it some kind of protocol for event-driven service architectures? Something else? I found a W3C standard for it, but it'd be nice to have a higher-level explanation.
WebSub's biggest advantage from what I can tell is minimizing the load on the publishers. Instead of them having to manage webhooks to send out to, or having hundreds of thousands of clients polling them every minute, they can let a Hub do all the work for them.
Cool!
(Also, on a tangent: I like the clean aesthetic of the website -- which apparently owes to its use of "gd.css", a tag-only CSS reset alternative. TIL)
A couple of days ago[0] I discovered WebSub and thought it was a very neat technology. After hearing some complaints about the existing providers (one incumbent and one legacy) I decided to make one with Elixir[1]! It's a pretty invisible service, but now many Wordpress users are using it to publish out updates to their blog, which is very neat. Let me know if you have any questions!
[0] - https://news.ycombinator.com/item?id=29868055 [1] - https://github.com/clone1018/WebSubHub