I like the idea, but I'd like to understand a bit more what/how it does its thing.
Looking at your example, its unclear to me how consumers and producers are distinguished by the bus. If I call $kernel->post($bus1, "some_message", "some", "args"); Does the bus do something like this? $kernel->post($consumer2, "some_message", "some", "args"); $kernel->post($consumer2, "some_message", "some", "args"); Also, why do producer need to attach themselves? If the bus is a session with an alias, anyone can post a message to it, no? -Mathieu > my $bus1 = MessageBus->new; > my $bus2 = MessageBus->new; > > my $producer = Session->new; > $producer->attach( $bus1 ); > $producer->attach( $bus2 ); > > my $consumer1 = Session->new; > my $consumer2 = Session->new; > my $consumer3 = Session->new; > > $consumer1->attach( $bus1 ); > $consumer2->attach( $bus1 ); > $consumer3->attach( $bus2 ); > > Events can now flow on each bus. Only sessions that > attach to a > specific bus can send or receive messages on this bus. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
