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

NAME

HTTP::Server::EV::Buffer - Non-blocking output buffer.

GLOBAL PARAMETERS

$HTTP::Server::EV::Buffer::autoflush = 1024*10; # Default buffered data size in bytes when buffer starts waiting socket to be writable to send data. Setting 0 disables buffering, data will be sent as soon as socket becomes writable.

METHODS

new({ fh => $sock_handle , flush => autoflush_threshold(optional), onerror => sub { onerror(disconect) optional callback} });

Creates new HTTP::Server::EV::Buffer object.

$buffer->print(@args)

Prints data to buffer.

$buffer->flush( $flush_threshold(optional) )

Sends all buffered data to socket and sets new flush threshold if $flush_threshold defined;

$buffer->{onerror} = sub {} or $buffer->onerror(sub {})

Set onerror callback, which called when client disconeted before cerver closed connection.

$buffer->{error_w}->start

Call this after ->new if you use H:S:E:Buffer without HTTP::Server::EV and need onerror callback. Don't think about it when use buffer object from HTTP::Server::EV::CGI object.