r50260 - in /branches/upstream/libanyevent-perl/current: Changes META.json META.yml README lib/AnyEvent.pm lib/AnyEvent/Intro.pod lib/AnyEvent/Socket.pm

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Tue Jan 5 18:28:45 UTC 2010


Author: jawnsy-guest
Date: Tue Jan  5 18:28:40 2010
New Revision: 50260

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=50260
Log:
[svn-upgrade] Integrating new upstream version, libanyevent-perl (5.240)

Modified:
    branches/upstream/libanyevent-perl/current/Changes
    branches/upstream/libanyevent-perl/current/META.json
    branches/upstream/libanyevent-perl/current/META.yml
    branches/upstream/libanyevent-perl/current/README
    branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Intro.pod
    branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm

Modified: branches/upstream/libanyevent-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/Changes?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/Changes (original)
+++ branches/upstream/libanyevent-perl/current/Changes Tue Jan  5 18:28:40 2010
@@ -1,4 +1,10 @@
 Revision history for Perl extension AnyEvent.
+
+5.24  Tue Jan  5 11:39:43 CET 2010
+	- cygwin never reports errors from failed connects. 1.5 just gives
+          you continous readyness and EAGAIN, 1.7 is even more broken and
+          just hangs. work around both issues in a cygwin-specific hack.
+	- improve idle watcher documentation slightly.
 
 5.23  Sun Dec 20 23:48:00 CET 2009
 	- support IDNs in resolve_sockaddr, and therefore in tcp_connect.

Modified: branches/upstream/libanyevent-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.json?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.json (original)
+++ branches/upstream/libanyevent-perl/current/META.json Tue Jan  5 18:28:40 2010
@@ -1,1 +1,1 @@
-{"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.54","distribution_type":"module","version":"5.23","name":"AnyEvent","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{},"recommends":{"Net::SSLeay":1.33,"Guard":1.02,"EV":3.05,"Async::Interrupt":1,"JSON::XS":2.2,"JSON":2.09},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}
+{"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.54","distribution_type":"module","version":"5.24","name":"AnyEvent","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{},"recommends":{"Net::SSLeay":1.33,"Guard":1.02,"EV":3.05,"Async::Interrupt":1,"JSON::XS":2.2,"JSON":2.09},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}

Modified: branches/upstream/libanyevent-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/META.yml?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/META.yml (original)
+++ branches/upstream/libanyevent-perl/current/META.yml Tue Jan  5 18:28:40 2010
@@ -11,7 +11,7 @@
    },
    "generated_by" : "ExtUtils::MakeMaker version 6.54",
    "distribution_type" : "module",
-   "version" : "5.23",
+   "version" : "5.24",
    "name" : "AnyEvent",
    "author" : [],
    "license" : "unknown",

Modified: branches/upstream/libanyevent-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/README?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/README (original)
+++ branches/upstream/libanyevent-perl/current/README Tue Jan  5 18:28:40 2010
@@ -488,18 +488,21 @@
   IDLE WATCHERS
        $w = AnyEvent->idle (cb => <callback>);
 
-    Sometimes there is a need to do something, but it is not so important to
-    do it instantly, but only when there is nothing better to do. This
-    "nothing better to do" is usually defined to be "no other events need
-    attention by the event loop".
-
-    Idle watchers ideally get invoked when the event loop has nothing better
-    to do, just before it would block the process to wait for new events.
-    Instead of blocking, the idle watcher is invoked.
-
-    Most event loops unfortunately do not really support idle watchers (only
-    EV, Event and Glib do it in a usable fashion) - for the rest, AnyEvent
-    will simply call the callback "from time to time".
+    Repeatedly invoke the callback after the process becomes idle, until
+    either the watcher is destroyed or new events have been detected.
+
+    Idle watchers are useful when there is a need to do something, but it is
+    not so important (or wise) to do it instantly. The callback will be
+    invoked only when there is "nothing better to do", which is usually
+    defined as "all outstanding events have been handled and no new events
+    have been detected". That means that idle watchers ideally get invoked
+    when the event loop has just polled for new events but none have been
+    detected. Instead of blocking to wait for more events, the idle watchers
+    will be invoked.
+
+    Unfortunately, most event loops do not really support idle watchers
+    (only EV, Event and Glib do it in a usable fashion) - for the rest,
+    AnyEvent will simply call the callback "from time to time".
 
     Example: read lines from STDIN, but only process them when the program
     is otherwise idle:
@@ -1802,12 +1805,17 @@
 
 FORK
     Most event libraries are not fork-safe. The ones who are usually are
-    because they rely on inefficient but fork-safe "select" or "poll" calls.
-    Only EV is fully fork-aware.
+    because they rely on inefficient but fork-safe "select" or "poll" calls
+    - higher performance APIs such as BSD's kqueue or the dreaded Linux
+    epoll are usually badly thought-out hacks that are incompatible with
+    fork in one way or another. Only EV is fully fork-aware and ensures that
+    you continue event-processing in both parent and child (or both, if you
+    know what you are doing).
 
     This means that, in general, you cannot fork and do event processing in
-    the child if a watcher was created before the fork (which in turn
-    initialises the event library).
+    the child if the event library was initialised before the fork (which
+    usually happens when the first AnyEvent watcher is created, or the
+    library is loaded).
 
     If you have to fork, you must either do so *before* creating your first
     watcher OR you must not use AnyEvent at all in the child OR you must do
@@ -1817,7 +1825,10 @@
     much more complicated: even for backends that *are* fork-aware or
     fork-safe, their behaviour is not usually what you want: fork clones all
     watchers, that means all timers, I/O watchers etc. are active in both
-    parent and child, which is almost never what you want.
+    parent and child, which is almost never what you want. USing "exec" to
+    start worker children from some kind of manage rprocess is usually
+    preferred, because it is much easier and cleaner, at the expense of
+    having to have another binary.
 
 SECURITY CONSIDERATIONS
     AnyEvent can be forced to load any event model via

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent.pm Tue Jan  5 18:28:40 2010
@@ -505,16 +505,19 @@
 
    $w = AnyEvent->idle (cb => <callback>);
 
-Sometimes there is a need to do something, but it is not so important
-to do it instantly, but only when there is nothing better to do. This
-"nothing better to do" is usually defined to be "no other events need
-attention by the event loop".
-
-Idle watchers ideally get invoked when the event loop has nothing
-better to do, just before it would block the process to wait for new
-events. Instead of blocking, the idle watcher is invoked.
-
-Most event loops unfortunately do not really support idle watchers (only
+Repeatedly invoke the callback after the process becomes idle, until
+either the watcher is destroyed or new events have been detected.
+
+Idle watchers are useful when there is a need to do something, but it
+is not so important (or wise) to do it instantly. The callback will be
+invoked only when there is "nothing better to do", which is usually
+defined as "all outstanding events have been handled and no new events
+have been detected". That means that idle watchers ideally get invoked
+when the event loop has just polled for new events but none have been
+detected. Instead of blocking to wait for more events, the idle watchers
+will be invoked.
+
+Unfortunately, most event loops do not really support idle watchers (only
 EV, Event and Glib do it in a usable fashion) - for the rest, AnyEvent
 will simply call the callback "from time to time".
 
@@ -1155,7 +1158,7 @@
 
 use Carp ();
 
-our $VERSION = '5.23';
+our $VERSION = '5.24';
 our $MODEL;
 
 our $AUTOLOAD;
@@ -1166,8 +1169,9 @@
 our $VERBOSE;
 
 BEGIN {
-   eval "sub WIN32(){ " . (($^O =~ /mswin32/i)*1) ." }";
-   eval "sub TAINT(){ " . (${^TAINT}*1) . " }";
+   eval "sub CYGWIN(){" . (($^O =~ /cygwin/i) *1) . "}";
+   eval "sub WIN32 (){" . (($^O =~ /mswin32/i)*1) . "}";
+   eval "sub TAINT (){" . (${^TAINT}          *1) . "}";
 
    delete @ENV{grep /^PERL_ANYEVENT_/, keys %ENV}
       if ${^TAINT};
@@ -2536,12 +2540,17 @@
 =head1 FORK
 
 Most event libraries are not fork-safe. The ones who are usually are
-because they rely on inefficient but fork-safe C<select> or C<poll>
-calls. Only L<EV> is fully fork-aware.
-
-This means that, in general, you cannot fork and do event processing
-in the child if a watcher was created before the fork (which in turn
-initialises the event library).
+because they rely on inefficient but fork-safe C<select> or C<poll> calls
+- higher performance APIs such as BSD's kqueue or the dreaded Linux epoll
+are usually badly thought-out hacks that are incompatible with fork in
+one way or another. Only L<EV> is fully fork-aware and ensures that you
+continue event-processing in both parent and child (or both, if you know
+what you are doing).
+
+This means that, in general, you cannot fork and do event processing in
+the child if the event library was initialised before the fork (which
+usually happens when the first AnyEvent watcher is created, or the library
+is loaded).
 
 If you have to fork, you must either do so I<before> creating your first
 watcher OR you must not use AnyEvent at all in the child OR you must do
@@ -2551,7 +2560,10 @@
 is much more complicated: even for backends that I<are> fork-aware or
 fork-safe, their behaviour is not usually what you want: fork clones all
 watchers, that means all timers, I/O watchers etc. are active in both
-parent and child, which is almost never what you want.
+parent and child, which is almost never what you want. USing C<exec>
+to start worker children from some kind of manage rprocess is usually
+preferred, because it is much easier and cleaner, at the expense of having
+to have another binary.
 
 
 =head1 SECURITY CONSIDERATIONS

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Intro.pod
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Intro.pod?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Intro.pod (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Intro.pod Tue Jan  5 18:28:40 2010
@@ -393,7 +393,7 @@
 =head2 Timers and other event sources
 
 So far, we have only used I/O watchers. These are useful mainly to find
-out whether a Socket has data to read, or space to write more data. On sane
+out whether a socket has data to read, or space to write more data. On sane
 operating systems this also works for console windows/terminals (typically
 on standard input), serial lines, all sorts of other devices, basically
 almost everything that has a file descriptor but isn't a file itself. (As

Modified: branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm?rev=50260&op=diff
==============================================================================
--- branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm (original)
+++ branches/upstream/libanyevent-perl/current/lib/AnyEvent/Socket.pm Tue Jan  5 18:28:40 2010
@@ -937,8 +937,18 @@
                      $state{next}();
                   });
                } else {
-                  # dummy read to fetch real error code
-                  sysread $state{fh}, my $buf, 1 if $! == Errno::ENOTCONN;
+                  if ($! == Errno::ENOTCONN) {
+                     # dummy read to fetch real error code if !cygwin
+                     sysread $state{fh}, my $buf, 1;
+
+                     # cygwin 1.5 continously reports "ready' but never delivers
+                     # an error with getpeername or sysread.
+                     # cygwin 1.7 only reports readyness *once*, but is otherwise
+                     # the same, which is atcually more broken.
+                     # Work around both by using unportable SO_ERROR for cygwin.
+                     $! = (unpack "l", getsockopt $state{fh}, Socket::SOL_SOCKET(), Socket::SO_ERROR()) || Errno::EAGAIN
+                        if AnyEvent::CYGWIN && $! == Errno::EAGAIN;
+                  }
 
                   return if $! == Errno::EAGAIN; # skip spurious wake-ups
 




More information about the Pkg-perl-cvs-commits mailing list