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();
max_size
size of the buffer, default is 200
callback
# Callback must follow the call signature $callback->(@data_entries); callback function which will process the data once the buffer has been filled
push
$buffer->push(@data); pushes data to buffer
flush
$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.
To install Data::AnyXfer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::AnyXfer
CPAN shell
perl -MCPAN -e shell install Data::AnyXfer
For more information on module installation, please visit the detailed CPAN module installation guide.