No such thing as a small change | |
PerlMonks |
Re: POE and Websocketsby rcaputo (Chaplain) |
on Jun 24, 2012 at 21:47 UTC ( [id://978088]=note: print w/replies, xml ) | Need Help?? |
There are probably more topical resources for POE help, like POE's mailing list or irc.perl.org channel #poe, depending whether you prefer long-form answers or quicker, specific assistance. There's also POE's wiki, which includes this introductory article and a Cookbook with several examples. POE is a callback-based event reactor. When something happens, such as when data appears on a socket, POE's Kernel notifies your code that it can safely read from the socket. POE::Kernel's API hides the details of several event loops, including low-level loops like Ev, and high-level graphical toolkits like Prima. POE's callback model may be confusing because it's name-based rather than code-reference based. Named events make certain things easier, like mapping events to any kind of callback, and dynamically loading or reloading callbacks as needed. Some people store their objects in a database and load them (or reload them) as needed. Most people don't use the feature, though. POE::Session objects do a few different things, but they mainly act as namespaces for events. Multiple parts of a program can use the same event names, as long as each has a separate session. For example, multiple classes might use the same event name. It would be bad if they got each others' callbacks. That's a very basic, very high level synopsis of the two main POE classes. If you have more specific questions, I'll be happy to try answering them.
In Section
Seekers of Perl Wisdom
|
|