3 ms·
Have you ever queried a database? That's how. You just ask. If you don't get data, do deal with it. Yes, there is a polling loop. Is this bad? Nope. You just h
by JustSomeNobody 10y ago
Have you ever queried a database? That's how. You just ask. If you don't get data, do deal with it.
Yes, there is a polling loop. Is this bad? Nope. You just have to understand the system you're building. Will you get data in a mostly consistent timing? Polling works. Is is sporadic? Try event driven. One size does not fit all. Event driven should not be used for everything and it's not in any way more natural than polling.
- HeyImAlex 10y agoDefinitely varies by the system, but, in my small-business internal-software experience, 99% of the time polling is good enough. Something feels innately ugly about polling, but it's simple, has failure modes that are easy to understand, and gets the job done.
- AstralStorm 10y agoEasy? How do you send anything in a pure pull architecture?
- JustSomeNobody 10y agoIn a pure push, how do you ask for data to be resent? There's trade-offs either way. No way is "best"; it all depends on what you're doing. I communicate with equipment over TCP, that I have to poll. There's _no_ mechanism for push. You just work with what you have and do the very best you can.