in reply to Why are people not using POE?
This gets me thinking about a little overlay-layer for POE so you can get to HEAP, KERNEL through a hashref like:
And the use of ARG0, ARG1 ... to pass variables is a little weird to me. For instance an ErrorEvent handler receives 5 parameters that way (ARG0 to ARG4), from the manpage:sub blabla { my ($poe_args) = shift; $poe_args->{KERNEL}->yield("bla"); delete $poe_args->{HEAP}->job; }
whereas IMHO it would be more descriptive to have a hash with descriptive names, so you could do:... as follows: ARG0 = the return value of syscall(), ARG1 = errno() - the numeric value of the error generated, ARG2 = error() - a descriptive for the given error, ARG3 = the wheel id, and ARG4 = the handle on which the error occurred (stdout, stderr, etc.)
that way I didn't have to go to the manpage every time to see what ARG\d I'd need.sub errorhandler { my ($poe_args) = shift; if ($poe_args->{ERRNO} == 2) { print $poe_args->{ERROR}; }; }
That being said, I still think POE is a great set of modules that I liked using, and will use more in the future.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why are people not using POE?
by rcaputo (Chaplain) on Jun 10, 2005 at 20:14 UTC | |
|
Re^2: Why are people not using POE?
by kscaldef (Pilgrim) on Jun 10, 2005 at 17:54 UTC |