Data::AnyXfer::Elastic::Import::Utils::Buffer - Buffer class
This module provides methods for buffer action
use Data::AnyXfer::Elastic::Import::Utils::Buffer; my $buffer = Data::AnyXfer::Elastic::Import::Utils::Buffer->new( callback => $sub ); # push data into buffer $buffer->push(@data); # called automatically when more than c<max_size> items have # been added to the buffer using c<push> $buffer->flush();
size of the buffer, default is 200
# Callback must follow the call signature $callback->(@data_entries); callback function which will process the data once the buffer has been filled
$buffer->push(@data); pushes data to buffer
$buffer->flush(); passes data to callback and clears buffer
This software is copyright (c) 2019, Anthony Lucas.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.