use Interact::Later; my $delayer = Interact::Later->new( cache_path => 'path/to/cache', file_extension => '.dmp' ); $delayer->write_data_to_disk($data); # Later... $delayer->get_oldest_file_in_cache(); # Do it until there are no more files... # Finally $delayer->clean_cache;
Can be used, for example, when you receive lots of
POST requests that you don't want to proceed right now to save database load.
This module will fastly store the data content on disk (with
Storable) without the need to use a database or a job queue. Assuming that Perl is fast at writing files to disk, we can hope good results. This is an experiment...