I long ago accepted that any asynchronous framework supporting a language that wasn't meant to do that natively is going to demand that it's users write some strange code to make things work, perhaps duplicating processes that must be done sync or asynchronously as a consequence.
Since I came to AnyEvent after several years of happily and successfully using POE, I was comfortable with this idea.
I initially entertained the switch because I really wanted an async-friendly memcached library (which is, at this point, ironic, since in order to get one I had to write my own).
I ultimately chose to switch when I realized that through careful creation of wrappers and abstractions, I would be able to use the same code for network, LDAP, DBD::Pg and memcached throughout my application---the bits that were written to run in a high-performance async setting, and the bits that are just meant to be called from a Catalyst application.
Being able to refactor my application to reduce redundancy and increase consistency of behavior has been worth the learning curve, and I never could have done that with POE, because POE's demands that you conform your application to its structure are just too great.
I'm not saying AnyEvent necessarily makes this easy---it's a hard problem to solve---but it's doable.
4 out of 5 found this review helpful. Was this review helpful to you? Yes No