NAME
ProgressMonitor::Stringify::ToCallback - a monitor implementation that provides stringified feedback to a callback.
SYNOPSIS
...
# call someTask and give it a monitor to call us back
# on callback, just do something unimaginative (print it...:-) and return 0 (don't cancel)
#
someTask(ProgressMonitor::Stringify::ToCallback->new({fields => [ ... ], tickCallback => sub { print "GOT: ", shift(), "\n"; 0; });
DESCRIPTION
This is a concrete implementation of a ProgressMonitor. It will send the stringified feedback to a callback (code ref) supplied by the user.
Inherits from ProgressMonitor::Stringify::AbstractMonitor.
METHODS
- new( $hashRef )
-
Note that the maxWidth must be set explicitly.
Configuration data:
- tickCallback
-
A code reference to an anonymous sub. For each rendering tick, it will be called with the rendered string as the argument. The return value will be used to set the cancellation status.
- messageCallback
-
A code reference that will be called specifically with the current message. Note that setting this changes the behavior of tickCallback; normally, tickCallback will receive the rendered string including any message. However, by setting messageCallback, the message will be skipped during rendition of the ordinary fields. Also, if this is set, the strategy used is of no importance.
- errorMessageCallback
-
A code reference that will be called with the current error message.
AUTHOR
Kenneth Olwing, <knth at cpan.org>
BUGS
I wouldn't be surprised! If you can come up with a minimal test that shows the problem I might be able to take a look. Even better, send me a patch.
Please report any bugs or feature requests to bug-progressmonitor at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ProgressMonitor. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find general documentation for this module with the perldoc command:
perldoc ProgressMonitor
ACKNOWLEDGEMENTS
Thanks to my family. I'm deeply grateful for you!
COPYRIGHT & LICENSE
Copyright 2006,2007 Kenneth Olwing, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.