ProgressMonitor::Stringify::ToCallback - a monitor implementation that provides


ProgressMonitor documentation  | view source Contained in the ProgressMonitor distribution.

Index


NAME

Top

ProgressMonitor::Stringify::ToCallback - a monitor implementation that provides stringified feedback to a callback.

SYNOPSIS

Top

  ...
  # 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

Top

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

Top

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

Top

Kenneth Olwing, <knth at cpan.org>

BUGS

Top

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

Top

You can find general documentation for this module with the perldoc command:

    perldoc ProgressMonitor

ACKNOWLEDGEMENTS

Top

Thanks to my family. I'm deeply grateful for you!

COPYRIGHT & LICENSE

Top


ProgressMonitor documentation  | view source Contained in the ProgressMonitor distribution.