[Catalyst] Using URIs for my app in another program

Byron Young Byron.Young at riverbed.com
Thu May 1 22:27:53 BST 2008


Hi all

I've run into a situation that I can't find a good solution to and am hoping to solicit some ideas from people on the list here.

An app I've been working on consists of two main parts - a Catalyst-based web app which provides the UI, and a daemon that does the heavy lifting.  They are totally separate applications that talk to one another via database.  The daemon will sometimes send emails to users when it finishes certain tasks that the users are interested in, and I want to include links in the emails that would bring the user to a Results page on the web app where they can get more information about the result of the task.

So, what I would like is to be able to call $c->uri_for() from my daemon.  Is there any 'sanctioned' way of doing that?  If possible, I'd like to avoid loading my whole catalyst app and somehow tricking it into believing its running under the same environment as my real app.

Another option is to use the database to pass URIs around.  Maybe a URI table that maps finished tasks to URIs.  However, I would rather just be able to arbitrarily call $c->uri_for() whenever I decide I need to include a URI in my daemon instead of having to create a table or column whenever I decide I want to send a link to a new type of resource.

Any suggestions?  Maybe I'm just going about it all wrong?

Thanks!

Byron



More information about the Catalyst mailing list