progress-any-eg-progressbar-06-reusing-task - Reusing the same task to track progress of two activities
This document describes version 0.005 of progress-any-eg-progressbar-06-reusing-task (from Perl distribution Progress-Any-Examples), released on 2020-07-09.
% progress-any-eg-progressbar-06-reusing-task [file_size1=10000] [file_size2=30000]
This example script shows the progress of simulated downloading of two files (the file sizes can be set via argument). The progress of each download will be tracked with the same task: download.
download
After the downloading of the first file is complete, we perform a reset() (a.k.a. update(pos => 0)) to the task to change its state from finished to started again.
reset()
update(pos => 0)
finished
started
Also notice the use of force_update argument in the update() to refresh the progress bar with a "Downloaded xxx" message.
force_update
update()
Please visit the project's homepage at https://metacpan.org/release/Progress-Any-Examples.
Source repository is at https://github.com/perlancar/perl-Progress-Any-Examples.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any-Examples
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020 by perlancar@cpan.org.
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 Progress::Any::Examples, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Progress::Any::Examples
CPAN shell
perl -MCPAN -e shell install Progress::Any::Examples
For more information on module installation, please visit the detailed CPAN module installation guide.