The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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.