I'm in the process of developing a prototype webapp that uses Comet.
The Perl side is CGI::Application and DBIx::Class. I'm using Orbited to do
Comet. I communicate to the MQ via STOMP.
I'd like to intercept calls to the DBand turn them into messages that go out to
the MQ.
So, if I do a $schema->resultset('MyTable')->update({ value => $value }), I
want to send a JSON message to the MQ along the lines of { op: 'update',
type: 'MyTable', data: { value: 5 }} , which is then received by the
STOMPClient on the webpage to update the DOM.
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?
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?
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?
Thanks to everyone who makes this module possible.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]