<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:garamond,new york,times,serif;font-size:12pt;color:#000000;"><div>I'm in the process of developing a prototype webapp that uses Comet.<br><br>The Perl side is CGI::Application and DBIx::Class. I'm using Orbited to do Comet. I communicate to the MQ via STOMP.<br><br>I'd like to intercept calls to the DBand turn them into messages that go out to the MQ. <br><br>So, if I do a $schema-&gt;resultset('MyTable')-&gt;update({ value =&gt; $value }), I want to send a JSON message to the MQ along the lines of { op:&nbsp; 'update',&nbsp; type: 'MyTable', data: { value: 5 }} , which is then received by the STOMPClient on the webpage to update the DOM.<br><br>I know there is a mechanism in DBIx::Class, DBIx::Class::Storage::Statistics used for getting access to the SQL and it is possible to use this to intercept and create the JSON messages - however - at that
 point it is a SQL string which requires parsing, which is not necessarily ideal. Is there a higher-level way to do this with the DBIx::Class API?<br><br>The approach that I'm taking today is to use Adam Kennedy's Aspect module to install pointcuts over the basic DBIx::Class::ResultSet methods I'm interested in - does that seem reasonable and can you envision any problems with that approach?<br><br>Given the shift to an world in which webapps are more event-driven (WebSockets,AMQP,XMPP) I can see this as a scenario that will become more common, what do you think?<br><br>Thanks to everyone who makes this module possible.<br><pre style=""><br></pre></div>
<!-- cg15.c1.mail.mud.yahoo.com compressed/chunked Fri Jan  8 07:52:28 PST 2010 -->
</div><br>



      </body></html>