NAME
Flux::Out - output stream interface
VERSION
version 1.00
SYNOPSIS
use Flux::Out;
$out->write($item);
$out->write_chunk(\@items);
$out->commit;
DESCRIPTION
Flux::Out is the role which every writing stream must implement.
INTERFACE
- write($item)
-
It receives one scalar
$itemas its argument.At the implementor's choice, it can process
$itemimmediately or keep its value untilcommit()is called.Return value semantics is not specified.
- write_chunk($chunk)
-
write_chunkreceives an arrayref with items ordered as they would be ifwritemethod was used instead.Return value semantics is not specified.
- commit()
-
commitmethod can flush cached data, print statistics or do anything neccessary to make sure that writing is completed correctly.Output stream implementation should make sure that stream is still usable after that.
SEE ALSO
Flux::Storage - role for persistent storages which are also output streams.
AUTHOR
Vyacheslav Matyukhin <me@berekuk.ru>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Yandex LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.