diff options
author | gregor herrmann <gregoa@debian.org> | 2022-08-19 18:04:03 +0200 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2022-08-19 18:04:03 +0200 |
commit | c90329ba62edd882e86ea508812fd8a835c9ba61 (patch) | |
tree | a55617def49caa2940643930eeac54c784a9b60c /lib/IO | |
parent | a8cd3c56ca2505161ef060de816cf659d647c3e9 (diff) |
New upstream version 0.802
Diffstat (limited to 'lib/IO')
36 files changed, 62 insertions, 43 deletions
diff --git a/lib/IO/Async.pm b/lib/IO/Async.pm index 6e0a353..1f27413 100644 --- a/lib/IO/Async.pm +++ b/lib/IO/Async.pm @@ -12,7 +12,7 @@ use warnings; # It is provided simply to keep CPAN happy: # cpan -i IO::Async -our $VERSION = '0.801'; +our $VERSION = '0.802'; =head1 NAME diff --git a/lib/IO/Async/Channel.pm b/lib/IO/Async/Channel.pm index 864e891..63f08df 100644 --- a/lib/IO/Async/Channel.pm +++ b/lib/IO/Async/Channel.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Notifier ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Debug.pm b/lib/IO/Async/Debug.pm index 147ff61..e336fde 100644 --- a/lib/IO/Async/Debug.pm +++ b/lib/IO/Async/Debug.pm @@ -8,7 +8,7 @@ package IO::Async::Debug; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; our $DEBUG = $ENV{IO_ASYNC_DEBUG} || 0; our $DEBUG_FD = $ENV{IO_ASYNC_DEBUG_FD}; diff --git a/lib/IO/Async/File.pm b/lib/IO/Async/File.pm index 2f1b9ca..b51fb6c 100644 --- a/lib/IO/Async/File.pm +++ b/lib/IO/Async/File.pm @@ -8,7 +8,7 @@ package IO::Async::File; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Timer::Periodic ); diff --git a/lib/IO/Async/FileStream.pm b/lib/IO/Async/FileStream.pm index b30b620..8c3fea6 100644 --- a/lib/IO/Async/FileStream.pm +++ b/lib/IO/Async/FileStream.pm @@ -8,7 +8,7 @@ package IO::Async::FileStream; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Stream ); diff --git a/lib/IO/Async/Function.pm b/lib/IO/Async/Function.pm index c28ff04..0baefe6 100644 --- a/lib/IO/Async/Function.pm +++ b/lib/IO/Async/Function.pm @@ -8,7 +8,7 @@ package IO::Async::Function; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Notifier ); use IO::Async::Timer::Countdown; diff --git a/lib/IO/Async/Future.pm b/lib/IO/Async/Future.pm index d9752c3..1754614 100644 --- a/lib/IO/Async/Future.pm +++ b/lib/IO/Async/Future.pm @@ -1,18 +1,22 @@ # You may distribute under the terms of either the GNU General Public License # or the Artistic License (the same terms as Perl itself) # -# (C) Paul Evans, 2013 -- leonerd@leonerd.org.uk +# (C) Paul Evans, 2013-2022 -- leonerd@leonerd.org.uk package IO::Async::Future; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( Future ); Future->VERSION( '0.05' ); # to respect subclassing +# Newer versions of Future have a proper subclassing-data API; for older +# versions we just treat it as a hashref +use constant FUTURE_HAS_UDATA => defined Future->can( "udata" ); + use Carp; =head1 NAME @@ -67,11 +71,19 @@ sub new my $proto = shift; my $self = $proto->SUPER::new; + my $loop; if( ref $proto ) { - $self->{loop} = $proto->{loop}; + $loop = $proto->loop; + } + else { + $loop = shift; + } + + if( FUTURE_HAS_UDATA ) { + $self->set_udata( loop => $loop ); } else { - $self->{loop} = shift; + $self->{loop} = $loop; } return $self; @@ -92,13 +104,13 @@ Returns the underlying L<IO::Async::Loop> object. sub loop { my $self = shift; - return $self->{loop}; + return FUTURE_HAS_UDATA ? $self->udata( "loop" ) : $self->{loop}; } sub await { my $self = shift; - $self->{loop}->await( $self ); + $self->loop->await( $self ); } =head2 done_later diff --git a/lib/IO/Async/Handle.pm b/lib/IO/Async/Handle.pm index 81d9a36..68997e1 100644 --- a/lib/IO/Async/Handle.pm +++ b/lib/IO/Async/Handle.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Notifier ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Internals/ChildManager.pm b/lib/IO/Async/Internals/ChildManager.pm index 5f5fd62..5ace011 100644 --- a/lib/IO/Async/Internals/ChildManager.pm +++ b/lib/IO/Async/Internals/ChildManager.pm @@ -8,7 +8,7 @@ package IO::Async::Internals::ChildManager; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; # Not a notifier diff --git a/lib/IO/Async/Internals/Connector.pm b/lib/IO/Async/Internals/Connector.pm index 8ff2186..6756afa 100644 --- a/lib/IO/Async/Internals/Connector.pm +++ b/lib/IO/Async/Internals/Connector.pm @@ -9,7 +9,7 @@ package # hide from CPAN use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Scalar::Util qw( weaken blessed ); diff --git a/lib/IO/Async/Internals/FunctionWorker.pm b/lib/IO/Async/Internals/FunctionWorker.pm index b2b808c..d7de859 100644 --- a/lib/IO/Async/Internals/FunctionWorker.pm +++ b/lib/IO/Async/Internals/FunctionWorker.pm @@ -8,7 +8,7 @@ package IO::Async::Internals::FunctionWorker; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; # Called directly by IO::Async::Function::Worker when used in "code" mode, # or by run_worker() below. diff --git a/lib/IO/Async/Listener.pm b/lib/IO/Async/Listener.pm index dfeb0ee..b8a7359 100644 --- a/lib/IO/Async/Listener.pm +++ b/lib/IO/Async/Listener.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Handle ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use IO::Async::Handle; use IO::Async::OS; diff --git a/lib/IO/Async/Loop.pm b/lib/IO/Async/Loop.pm index 95b18b4..adf3ce2 100644 --- a/lib/IO/Async/Loop.pm +++ b/lib/IO/Async/Loop.pm @@ -8,7 +8,7 @@ package IO::Async::Loop; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; # When editing this value don't forget to update the docs below use constant NEED_API_VERSION => '0.33'; diff --git a/lib/IO/Async/Loop/Poll.pm b/lib/IO/Async/Loop/Poll.pm index e7cf107..1958e24 100644 --- a/lib/IO/Async/Loop/Poll.pm +++ b/lib/IO/Async/Loop/Poll.pm @@ -8,7 +8,7 @@ package IO::Async::Loop::Poll; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use constant API_VERSION => '0.49'; use base qw( IO::Async::Loop ); diff --git a/lib/IO/Async/Loop/Select.pm b/lib/IO/Async/Loop/Select.pm index 012bb70..7bd0fe3 100644 --- a/lib/IO/Async/Loop/Select.pm +++ b/lib/IO/Async/Loop/Select.pm @@ -8,7 +8,7 @@ package IO::Async::Loop::Select; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use constant API_VERSION => '0.49'; use base qw( IO::Async::Loop ); diff --git a/lib/IO/Async/LoopTests.pm b/lib/IO/Async/LoopTests.pm index 1b4400d..555f06b 100644 --- a/lib/IO/Async/LoopTests.pm +++ b/lib/IO/Async/LoopTests.pm @@ -28,7 +28,7 @@ use POSIX qw( SIGTERM ); use Socket qw( sockaddr_family AF_UNIX ); use Time::HiRes qw( time ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; # Abstract Units of Time use constant AUT => $ENV{TEST_QUICK_TIMERS} ? 0.1 : 1; @@ -369,7 +369,9 @@ sub run_tests_io # Check that error conditions that aren't true read/write-ability are still # invoked - { + SKIP: { + skip "cygwin does not indicate read-ready on exceptional sockets", 1 if $^O eq "cygwin"; + my ( $S1, $S2 ) = IO::Async::OS->socketpair( 'inet', 'dgram' ) or die "Cannot create AF_INET/SOCK_DGRAM connected pair - $!"; $_->blocking( 0 ) for $S1, $S2; $S2->close; diff --git a/lib/IO/Async/Notifier.pm b/lib/IO/Async/Notifier.pm index 33e69f5..6cd8fb2 100644 --- a/lib/IO/Async/Notifier.pm +++ b/lib/IO/Async/Notifier.pm @@ -8,7 +8,7 @@ package IO::Async::Notifier; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; use Scalar::Util qw( weaken ); @@ -466,6 +466,7 @@ sub remove_child LOOP: { my $childrenref = $self->{IO_Async_Notifier__children}; for my $i ( 0 .. $#$childrenref ) { + no warnings 'uninitialized'; next unless $childrenref->[$i] == $child; splice @$childrenref, $i, 1, (); last LOOP; diff --git a/lib/IO/Async/OS.pm b/lib/IO/Async/OS.pm index 6894640..f6c2394 100644 --- a/lib/IO/Async/OS.pm +++ b/lib/IO/Async/OS.pm @@ -8,7 +8,7 @@ package IO::Async::OS; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; our @ISA = qw( IO::Async::OS::_Base ); diff --git a/lib/IO/Async/OS/MSWin32.pm b/lib/IO/Async/OS/MSWin32.pm index 6d5279e..d36c611 100644 --- a/lib/IO/Async/OS/MSWin32.pm +++ b/lib/IO/Async/OS/MSWin32.pm @@ -8,7 +8,7 @@ package IO::Async::OS::MSWin32; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; our @ISA = qw( IO::Async::OS::_Base ); diff --git a/lib/IO/Async/OS/cygwin.pm b/lib/IO/Async/OS/cygwin.pm index 8d01c74..f9f4f52 100644 --- a/lib/IO/Async/OS/cygwin.pm +++ b/lib/IO/Async/OS/cygwin.pm @@ -8,7 +8,7 @@ package IO::Async::OS::cygwin; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; our @ISA = qw( IO::Async::OS::_Base ); diff --git a/lib/IO/Async/OS/linux.pm b/lib/IO/Async/OS/linux.pm index 88979e0..44c849a 100644 --- a/lib/IO/Async/OS/linux.pm +++ b/lib/IO/Async/OS/linux.pm @@ -8,7 +8,7 @@ package IO::Async::OS::linux; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; our @ISA = qw( IO::Async::OS::_Base ); diff --git a/lib/IO/Async/PID.pm b/lib/IO/Async/PID.pm index af5f2c3..84b1967 100644 --- a/lib/IO/Async/PID.pm +++ b/lib/IO/Async/PID.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Notifier ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Process.pm b/lib/IO/Async/Process.pm index fad4740..ec71052 100644 --- a/lib/IO/Async/Process.pm +++ b/lib/IO/Async/Process.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Notifier ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Protocol.pm b/lib/IO/Async/Protocol.pm index c6f6e9c..61ccba4 100644 --- a/lib/IO/Async/Protocol.pm +++ b/lib/IO/Async/Protocol.pm @@ -8,7 +8,7 @@ package IO::Async::Protocol; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Notifier ); diff --git a/lib/IO/Async/Protocol/LineStream.pm b/lib/IO/Async/Protocol/LineStream.pm index 95b0930..d267db1 100644 --- a/lib/IO/Async/Protocol/LineStream.pm +++ b/lib/IO/Async/Protocol/LineStream.pm @@ -8,7 +8,7 @@ package IO::Async::Protocol::LineStream; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Protocol::Stream ); diff --git a/lib/IO/Async/Protocol/Stream.pm b/lib/IO/Async/Protocol/Stream.pm index c3aac3c..95b96ca 100644 --- a/lib/IO/Async/Protocol/Stream.pm +++ b/lib/IO/Async/Protocol/Stream.pm @@ -8,7 +8,7 @@ package IO::Async::Protocol::Stream; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Protocol ); diff --git a/lib/IO/Async/Resolver.pm b/lib/IO/Async/Resolver.pm index 55cc6f2..fd8d6ba 100644 --- a/lib/IO/Async/Resolver.pm +++ b/lib/IO/Async/Resolver.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Function ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; # Socket 2.006 fails to getaddrinfo() AI_NUMERICHOST properly on MSWin32 use Socket 2.007 qw( diff --git a/lib/IO/Async/Routine.pm b/lib/IO/Async/Routine.pm index ef4085c..0420bc5 100644 --- a/lib/IO/Async/Routine.pm +++ b/lib/IO/Async/Routine.pm @@ -8,7 +8,7 @@ package IO::Async::Routine; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Notifier ); diff --git a/lib/IO/Async/Signal.pm b/lib/IO/Async/Signal.pm index 88f3d81..fc0bb98 100644 --- a/lib/IO/Async/Signal.pm +++ b/lib/IO/Async/Signal.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Notifier ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Socket.pm b/lib/IO/Async/Socket.pm index 67114aa..1788e37 100644 --- a/lib/IO/Async/Socket.pm +++ b/lib/IO/Async/Socket.pm @@ -8,7 +8,7 @@ package IO::Async::Socket; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Handle ); diff --git a/lib/IO/Async/Stream.pm b/lib/IO/Async/Stream.pm index 2cd9f78..b923a81 100644 --- a/lib/IO/Async/Stream.pm +++ b/lib/IO/Async/Stream.pm @@ -8,7 +8,7 @@ package IO::Async::Stream; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use base qw( IO::Async::Handle ); diff --git a/lib/IO/Async/Test.pm b/lib/IO/Async/Test.pm index 5a1ebe0..d86d1fb 100644 --- a/lib/IO/Async/Test.pm +++ b/lib/IO/Async/Test.pm @@ -8,7 +8,7 @@ package IO::Async::Test; use strict; use warnings; -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Exporter 'import'; our @EXPORT = qw( @@ -124,11 +124,13 @@ Defaults to 10 seconds. =cut +our $Level = 0; + sub wait_for(&@) { my ( $cond, %opts ) = @_; - my ( undef, $callerfile, $callerline ) = caller; + my ( undef, $callerfile, $callerline ) = caller( $Level ); my $timedout = 0; my $timerid = $loop->watch_time( @@ -187,6 +189,7 @@ sub wait_for_stream(&$$) } ); + local $Level = $Level + 1; # Have to defeat the prototype... grr I hate these &wait_for( $cond ); @@ -211,6 +214,7 @@ sub wait_for_future { my ( $future ) = @_; + local $Level = $Level + 1; wait_for { $future->is_ready }; return $future; diff --git a/lib/IO/Async/Timer.pm b/lib/IO/Async/Timer.pm index 1159ccd..9330b14 100644 --- a/lib/IO/Async/Timer.pm +++ b/lib/IO/Async/Timer.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Notifier ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Timer/Absolute.pm b/lib/IO/Async/Timer/Absolute.pm index 28832cf..ae7962b 100644 --- a/lib/IO/Async/Timer/Absolute.pm +++ b/lib/IO/Async/Timer/Absolute.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Timer ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Timer/Countdown.pm b/lib/IO/Async/Timer/Countdown.pm index d83899c..b3c9113 100644 --- a/lib/IO/Async/Timer/Countdown.pm +++ b/lib/IO/Async/Timer/Countdown.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Timer ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; diff --git a/lib/IO/Async/Timer/Periodic.pm b/lib/IO/Async/Timer/Periodic.pm index 9427f0c..8349210 100644 --- a/lib/IO/Async/Timer/Periodic.pm +++ b/lib/IO/Async/Timer/Periodic.pm @@ -9,7 +9,7 @@ use strict; use warnings; use base qw( IO::Async::Timer ); -our $VERSION = '0.801'; +our $VERSION = '0.802'; use Carp; |