Ivan Ratnikov > HTTP-Server-EV-0.41 > HTTP::Server::EV::BufTie

Download:
HTTP-Server-EV-0.41.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  1
View/Report Bugs
Module Version: 0.41   Source   Latest Release: HTTP-Server-EV-0.68

NAME ^

HTTP::Server::EV::BufTie - Internal class used by HTTP::Server::EV::CGI for proxifying output to correct HTTP::Server::EV::Buffer.

DESCRIPTION ^

Mainly it`s workaround for bug of localizing *STDOUT(no only it, all global vars also) in Coro threads, when calling HTTP::Server::EV::CGI->attach(local *STDOUT) overwrites STDOUT in all now runing coros. That happens because local() doesn`t create lexical copy of var, it pushes old value to stack and sets new value to glob var, old value is restored when interpreter leaves the scope. So localizing variable in one coro overwrites it in all other.

BUGS ^

One coro thread - one socket. All handles attached in coro thread will refer to one socket that attached to filehandle last. It`s possible to support attaching different sockets to different handles in same coro thread by constructing tie object on flow, but it slow and generally needn't, so not implemented.

syntax highlighting: