If you choose to take this experiment further and go deeper, you will discover something even more fun: reentrancy.
... That, and how software interrupts work at the kernel level. Happy hunting!
EDIT: In anticipation of an eventual response, I just realized how condescending this sounds at first glance. I meant it in good faith.
The article is fine, but call it what it is: abusing the Unix signal system for shit and giggles. Nothing wrong with that.
A named pipe (like Postfix sendmail uses) seems slightly more sane.
Corporate tried to push us to replace it with SQS and it could not keep up / costs with through the roof
"Yes, we built a message broker using nothing but UNIX signals and a bit of Ruby magic. Sure, it’s not production-ready, and you definitely shouldn’t use this in your next startup (please don’t), but that was never the point.
"The real takeaway here isn’t the broker itself: it’s understanding how the fundamentals work. We explored binary operations, UNIX signals, and IPC in a hands-on way that most people never bother with.
"We took something “useless” and made it work, just for fun. So next time someone asks you about message brokers, you can casually mention that you once built (or saw) one using just two signals. And if they look at you weird, well, that’s their problem. Now go build something equally useless and amazing. The world needs more hackers who experiment just for the fun of it."
bradleybuda•1h ago
bradleybuda•1h ago
toast0•1h ago
cannonpalms•1h ago
o11c•1h ago
Signals are generally the slowest IPC method, unless you're doing something stupid with a different method.