Subject: | $stream->close does not invoke current on_read handler with $closed==true |
$ cat rt-todo.pl
#!/usr/bin/perl
use strict;
use warnings;
use IO::Async::Stream;
use IO::Async::Loop;
my $loop = IO::Async::Loop->new;
my ( $S1, $S2 ) = $loop->socketpair;
my $stream = IO::Async::Stream->new(
handle => $S1,
on_read => sub { print STDERR "on_read: @_\n" },
on_closed => sub { print STDERR "on_closed: @_\n" },
);
$loop->add( $stream );
$stream->close;
$loop->loop_forever;
$ perl rt-todo.pl
on_closed: IO::Async::Stream=HASH(0x140f910)
^C
####
Expected first to see
on_read: IO::Async::Stream=HASH(0x...) SCALAR(0x...) 1
--
Paul Evans