NAME

Pcore::AE::Handle - AnyEvent::Handle subclass with proxy support

SYNOPSIS

DESCRIPTION

ATTRIBUTES

Refer to the AnyEvent::Handle for the other base class attributes.

connect_timeout = <seconds>

Connect timeout in seconds.

proxy = [ <proxy_type>, <proxy> ]

proxy => [ 'socks5', 'connect://127.0.0.1:8080?socks5' ],

Proxy to use. First argument - is a preferred proxy type. Second argument - Pcore::Proxy object, or HashRef, that will be passed to the Pcore::Proxy constructor.

on_proxy_connect_error = sub ( $self, $reason, $proxy_error )

on_proxy_connect_error => sub ( $h, $reason, $proxy_error ) {
    return;
},

Error callback, called in the case of the proxy connection error.

CLASS METHODS

fetch ( $self, $id )

Fetch stored connection from the cache. Return undef if no cached connections for current id was found.

METHODS

Refer to the AnyEvent::Handle for the other base class methods.

store ( $self, $id, $timeout = "$CACHE_TIMEOUT" )

Store connection to the cache.

!!! WARNING !!! - on_error, on_eof, on_read and timeout attributes will be redefined when handle is stored. You need to restore this attributes manually after handle will be fetched from cache.

PACKAGE VARIABLES

$CACHE_TIMEOUT = 4

Defaul cache timeout is 4.

SEEE ALSO

AnyEvent::Handle, AnyEvent::Socket, Pcore::Proxy