On Mon, Jul 22, 2013 at 11:44 AM, Ash Moran <[email protected]>wrote:
> > On 22 Jul 2013, at 11:28, Francis Fish <[email protected]> wrote: > > > > with bus do > > > tell :turn_on > > > tell :add_leaves > > > end > > > > > > Self hasn't been changed unless that's how you built it - if this is a > bus dispatching messages to registered listeners, then the listeners are > expecting the message and the bus is just the way the messages are > delivered. Self of the listeners may change, but not necessarily. > > I (also?) thought you were trying to use this a shorthand for > `bus.tell(:turn_on)`, is that not what you meant? > > Bus is just distributing the turn_on message to its listeners? So not modifying self per se. The listeners will do stuff with the message (or not) but bus doesn't know anything, its only state is the list of listeners. I think it's a naming thing, hence broadcast would be better. But yeah, that pass a block and mess with internal state, yeuch - hard to debug. -- You received this message because you are subscribed to the Google Groups "NWRUG" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nwrug-members. For more options, visit https://groups.google.com/groups/opt_out.
