ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Impl/POE.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Impl/POE.pm (file contents):
Revision 1.25 by root, Sun Jun 28 11:43:51 2009 UTC vs.
Revision 1.26 by root, Wed Jul 8 02:01:12 2009 UTC

285} 285}
286 286
287sub io { 287sub io {
288 my ($class, %arg) = @_; 288 my ($class, %arg) = @_;
289 289
290 # cygwin requires the fh mode to be matching, unix doesn't 290 # POE itself might do the right thing, but some POE backends don't,
291 # so do the safe thing, it's not as if this will slow us down
292 # any further *g*
291 my ($fh, $pee) = AnyEvent::_dupfh $arg{poll}, $arg{fh}, "select_read", "select_write"; 293 my ($fh, $pee) = AnyEvent::_dupfh $arg{poll}, $arg{fh}, "select_read", "select_write";
292 294
293 my $cb = $arg{cb}; 295 my $cb = $arg{cb};
294 296
295 my $session = POE::Session->create ( 297 my $session = POE::Session->create (
296 inline_states => { 298 inline_states => {
297 _start => sub {
298 $_[KERNEL]->$pee ($fh => "ready"); 299 _start => sub { $_[KERNEL]->$pee ($fh => "ready") },
299 },
300 ready => sub { 300 ready => sub { $cb->() },
301 $cb->();
302 },
303 stop => sub {
304 $_[KERNEL]->$pee ($fh); 301 stop => sub { $_[KERNEL]->$pee ($fh) },
305 },
306 }, 302 },
307 ); 303 );
308 bless \\$session, "AnyEvent::Impl::POE" 304 bless \\$session, "AnyEvent::Impl::POE"
309} 305}
310 306

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines