NAME
UniEvent::Streamer::Output - Pure Perl Output stream bridge
DESCRIPTION
This is pure perl output stream, meant to be assigned with UniEvent::Streamer. It is assumed, that the class will consume data fed by UniEvent::Streamer.
For example, it can output the TCP Input stream into terminal, or calculate the input stream MD5 checksum.
It is derived from UniEvent::Streamer::IOutput.
METHODS
new()
Constructs new pupe perl output stream.
start($loop)
This method is invoked upon underlying UniEvent::Streamer start. Executed once per Streamer/Output lifetime.
stop()
This method is invoked upon underlying UniEvent::Streamer stop. Executed once per Streamer/Output lifetime. No any further I/O is expected.
write($data)
Consumes the input data. Meant to be overriden in descendant classes to do something useful.
The method returns XS::ErrorCode to let the UniEvent::Streamer know about success or failure of data consumption.
write_queue_size()
The method is invoked by the UniEvent::Streamer to determine max size of single data chunk.
handle_write($error_code)
This method can be invoked, to let the UniEvent::Streamer know, that something has happend with the output.