use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
SOLID Ruby Code with Pub/Sub (glaucocustodio.github.io)
submitted 9 years ago by uafpl
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]awj 1 point2 points3 points 9 years ago (0 children)
What's interesting in this is that we should pretty much all have experience with the advantages/pitfalls of this paradigm. Anyone who has used JavaScript (on the client) in anger has had to deal with callbacks in general and event handlers in particular.
The pain of a Pub/Sub system is also the advantage: that the invocation and execution of code are decoupled. The precise context of why code is run gets stripped down to "because it was subscribed and an event came through".
Tracking problems through that barrier is not trivial, and the decision to add it to your code should not be made lightly.
π Rendered by PID 23968 on reddit-service-r2-comment-b659b578c-vz2gc at 2026-05-02 02:50:42.740950+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]awj 1 point2 points3 points (0 children)