[Moscow.pm] Coro

Alexandr Gomoliako zzz zzz.org.ua
25 14:23:56 PST 2012


On Wed, Jan 25, 2012 at 11:28 PM, Dmitry Karasik <dmitry at karasik.eu.org> wrote:

> sub handle_connection
> {
>    my $socket = shift;
>    lambda {
>        context $socket, $timeout;
>    readable {
>        return 'timeout' unless shift;
>        sysread $socket, ...
>    writable {
>        return 'timeout' unless shift;
>        syswrite $socket, ...
>    }}}
> }

> ..  ,  ,       .

,    keep-alive ? ..  writable
  readable   .


Moscow-pm