Live data from Hacker News

REST Hooks - Stop the polling madness

resthooks.org

101–110 of 117 posts

Re: REST Hooks - Stop the polling madness

#101
I just want to point out that having read that entire page, I still have absolutely no idea what this is, how it works, etc.

I have a solution for polling. Its called websockets. Even more, there's a well-supported library called socket.io that transparently handles it for all browsers.

Re: REST Hooks - Stop the polling madness

#102
post #88

Earlier quoted context omitted.

Server A has events Server B wants to know about. With REST Hooks, Server A provides an API that Server B use to tell Server A "Please POST notifications about those events to this URL". Then Server B keeps a web server listening for requests to that url. There is no persistent connection. As for timeouts, check out http://resthooks.org/docs/retries/ for ideas on how those problems can be solved.

So it's an API to configure webhooks on Server A?

I think it's more of an API to allow Server B to register its interest in receiving notifications from Server A.

Of course, Server A must "speak Rest Hook" in order to enable that, so in a manner of speaking I guess it is a way to configure Webhooks on Server A.

But, it basically exposes a common interface for Server A and Server B to establish Webhooks. Server A can tell Server B which notification subscriptions are available (i.e. for which events), and Server B can then choose to subscribe, providing the callback URL for the Webhook.

Re: REST Hooks - Stop the polling madness

#103
post #26
post #8

Am I the only one who has trouble sifting through all this marketing? Even "read more" link leads to an article where half of the text promises what will be covered and another half talks about some subscriptions and how they are managed (they might have been mentioned in the first half, I agree - and I also read text only twice). If someone has a better understanding of how this works, I would appreciate a TL;DR ver…

We are pushing some copy updates to the homepage, most of the technical details were in docs. TL;DR coming to the homepage soon, but the gist is: REST Hooks itself is not a specification, it is a collection of patterns that treat webhooks like subscriptions. These subscriptions are manipulated via a REST API just like any other resource. That's it. Really. Thanks for the feedback!

Why make effort to explicitly state that it's not a specification? That makes it more confusing, as it really is defining a standard interface for exposing and establishing Webhooks--i.e. pretty much a spec. So, when I read that it's not a spec, it made me question for a second whether I truly understood it.

I also agree with a previous commenter who said it's unclear what you guys' role is. Are you just defining this "spec" to help the world, and hoping that the world gets on board? Or, are you offering some sort of service? Also, how would a dev just start using these, when it requires that the services they are consuming "speak Rest Hook?". It just seems like a good idea, but not immediately useful. If there was a simple call to action that said, "Hey devs, let's all use these when building services", then the pitch would be more understandable (assuming that's what you guys are promoting).

BTW, I do think it's a worthwhile idea. Personally, I've found Webhooks to be very simple, thus I'm not really sold on the "research" that indicates devs struggle with them more than they would Resthooks. So, that's not the sell to me. It's having a standard, programmatic way of discovering Webhook availability and consuming them across various services/APIs that's the draw in my book.

Anyway, good luck.

Re: REST Hooks - Stop the polling madness

#104
post #62

Earlier quoted context omitted.

I think they are just suggesting that services which are being polled frequently instead implement a rest-like subscription service which would accept an endpoint and then push the data to all of the subscribed endpoints when it changes. In many cases it is more work from the developers of those services but would reduce their bandwidth and server load immensely.

Ohhh, so it's really a server-side technology to better consume third-party APIs. For whatever reason, this wasn't at all obvious to me. I had initially assumed that this was technology between client and server sides of a single-page application.

As did I. I've built these systems (socket-like systems that work efficiently across browser in diverse environments). And if you think you can just get that right the first time, then either you have the hacking skills of which I have never seen or you are (more likely) wrong.

But this thing here they are talking about is something I've been doing for a long time. I didn't think about making a brochure site for it though.

Just follow the principle of making the parts as dumb as possible. They should be the stupidest simplest things ever. Sometimes you can't get to this model on the first try, and that's ok. But the closer you get to it, the better the product becomes. I swear this is true and part of the soul of the machine's ghost.

If you can't make things laterally connect this way, then make them vertically stack this way and then laterally connect this way. But don't obfuscate the objective.

Re: REST Hooks - Stop the polling madness

#105
post #26
post #8

Am I the only one who has trouble sifting through all this marketing? Even "read more" link leads to an article where half of the text promises what will be covered and another half talks about some subscriptions and how they are managed (they might have been mentioned in the first half, I agree - and I also read text only twice). If someone has a better understanding of how this works, I would appreciate a TL;DR ver…

We are pushing some copy updates to the homepage, most of the technical details were in docs. TL;DR coming to the homepage soon, but the gist is: REST Hooks itself is not a specification, it is a collection of patterns that treat webhooks like subscriptions. These subscriptions are manipulated via a REST API just like any other resource. That's it. Really. Thanks for the feedback!

This is how webhooks work in any API that has sufficiently embraced them (see Freshbooks for an example). Why are we pretending like this is something different?

Re: REST Hooks - Stop the polling madness

#106

The way the info is presented bugs me. The first "case study" is Zapier. Later, in the "Learn how..." set of links, Zapier is listed as one of many. Look to the footer, and the Github link, and it's of course evident it's a Zapier project. This project (er hmm, "initiative") is core to Zapier's business. If every service out there had a hook atop their service, it'd make things a lot easier for Zapier. That's cool. W…

I don't see how a company being involved with this "initiative" affects the core concept - it's a net benefit for both API consumer and producer in moving to a subscribe/push model. Less requests, less load, closer to real time updates. Swap Zapier with any other consumer and the result is the same

Re: REST Hooks - Stop the polling madness

#107
post #8

Am I the only one who has trouble sifting through all this marketing? Even "read more" link leads to an article where half of the text promises what will be covered and another half talks about some subscriptions and how they are managed (they might have been mentioned in the first half, I agree - and I also read text only twice). If someone has a better understanding of how this works, I would appreciate a TL;DR ver…

And here I thought I was being dense.

Seems like it adds data that would normally be included in a poll response to requests that were going to be made anyway, and possibly adds requests that were normally going to be made independently to long polls, though I'm not sure about any of this.

If I am right, would be nice to explain this and how it compensates if there is not a "regular" request within a certain period of time. And well, to basically explain WTH REST hooks are....

Is the most important piece of information really: "REST Hooks itself is not a specification, it is a collection of patterns that treat webhooks like subscriptions"? That seems of tertiary importance at best. How about telling us what REST Hooks are and how they are that - not what they aren't from a marketing perspective.

This is targeting a technical audience. It shouldn't so drastically underestimate its readers.

Re: REST Hooks - Stop the polling madness

#108

I hate to be THAT guy but someone was going to say it so it may as well be me :) This is a collection of patterns, right? Well why not make this really REST and rather than list a bunch of URL templates provide REL types for each of these like so: REL subscriptions-list -> GET subscription-create -> POST subscription-read -> GET subscription-update -> PUT subscription-destroy -> DELETE Now it doesn't matter what the…

[deleted]

Re: REST Hooks - Stop the polling madness

#109
post #45
post #8

Am I the only one who has trouble sifting through all this marketing? Even "read more" link leads to an article where half of the text promises what will be covered and another half talks about some subscriptions and how they are managed (they might have been mentioned in the first half, I agree - and I also read text only twice). If someone has a better understanding of how this works, I would appreciate a TL;DR ver…

You are not the only one. I read though it, clicked around, looked at the demos, thought about bookmarking it, got to the documentation page and saw this `/api/v1/subscription/`, thought That breaks HATEOAS then left. I'm sure if I put more time into trying to understand what is going on I could figure it out, but to me, the message isn't that clear.

I'm interested since my application publishes URLs just like that. What's wrong with it as far as HATEOAS is considered? How would it be better?

Re: REST Hooks - Stop the polling madness

#110
Give a man a hammer, everything looks like a nail. REST has become a bit of a hammer. The reason a lot of RESTful designed software I've seen has such poor performance is because REST is used like a hammer... everywhere! And whole bunch of places it's not needed and it's not ideal.
Post reply on HN