Now that I am starting to play a bigger and more formal Perl advocacy role via my company Shutterstock (more on that later) I get quite a few questions from people that are intermediate or advanced programmers who happen to be Perl illiterate (but desiring to learn). As a result these questions go beyond the basics of Perl syntax. I know how I would answer them, but I thought I'd try to occassionally share some really good questions with the community and hopefully glean some additional advice. I figure if I am being asked these questions, perhaps they are on the mind of many others and hopefully we can help clear up some confusion. So, here's the inaugural Newbie corner question:
What is the best way to do long polling / realtime web applications programming in Perl? Can this be integrated into some of the more populate web development frameworks such as Catalyst?
I get asked this a lot from people who read a lot of Node.js tutorials. Here's my basic answer.
I personally would build something using Plack + Twiggy + Pocket.IO since that seems to have pretty good documentation and fills the general requirement. However there is also Web::Hippie (which I haven't used) and also Mojolicious seems to have this built in.
Right now I don't see an easy way to integrate this type of application into my Catalyst based websites, since I can't find anything that does this (in the way that say REST is integrated into Catalyst via Catalyst::Action::REST). However since Catalyst is now Plack based, there is no reason why you couldn't combine a main application written in Catalyst with something written using Pocket.IO (or some other technology) via Plack's excellent builder tools.
I'll give a more detailed approach in a later part two, but I'd love to hear from the rest of the Perl experts out there first! How would you build such an application? What do you all thing would be a good example application that could be shared with experienced developers who happen to be new to Perl?
I, obviously, use PocketIO in production. It runs fine, but it owes a lot to AnyEvent, which is insanely stable and fast.
As for Catalyst check out Plack's FAQ, there is some information on how to run async nonblocking apps on frameworks that don't quite support it.
Posted by: vti | 09/26/2011 at 03:22 PM
Most of the techniques involved with pearl are outdated now, Mojolicious is another attempt to implement this idea with the state of the art technology.
Posted by: Web Development India | 10/19/2011 at 11:26 PM
Even I haven't use hippie but it is being said that it is quite easy to deal this situation with it. Would be giving it a try someday.
Posted by: Web Application Development Services | 01/20/2012 at 05:07 AM
I really need your help with this. We are planning on developing a realtime web application.
Posted by: Webmaster Blog | 08/26/2012 at 04:53 AM