From 43716dce93f0a2dd921be762621dd386c9346feb Mon Sep 17 00:00:00 2001 From: Nigel Horne Date: Mon, 14 Nov 2016 11:36:49 -0500 Subject: [PATCH] Move to POD style --- .appveyor.yml | 17 ++++++++ lib/Data/Fetch.pm | 103 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..aae884a --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,17 @@ +version: 1.0.{build} + +install: + - cinst StrawberryPerl + - path C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH% + - mkdir %APPVEYOR_BUILD_FOLDER%\tmp + - set TMPDIR=%APPVEYOR_BUILD_FOLDER%\tmp + - perl -V + - cpan App::cpanminus + - cpanm -q --showdeps --with-develop --with-suggests . | findstr /v "^perl\>" | cpanm -n + - 'echo End install at: & time /t' + +build_script: + - perl Makefile.PL + +test_script: + - dmake test diff --git a/lib/Data/Fetch.pm b/lib/Data/Fetch.pm index 07adedf..7288489 100755 --- a/lib/Data/Fetch.pm +++ b/lib/Data/Fetch.pm @@ -4,8 +4,38 @@ use strict; use warnings; use threads; +=head1 NAME + +Data::Fetch - give advance warning that you'll be needing a value + +=head1 VERSION + +Version 0.01 + +=cut + our $VERSION = '0.01'; +=head1 SYNOPSIS + +Sometimes we know in advance that we'll be needing a value which is going to take a long time to compute or determine. +This module fetches the value in the background so that you don't need to wait so long when you need the value + + use Data::Fetch; + my $fetcher = Data::Fetch->new(); + my $object = CalculatePi->new(places => 1000000); + $fetcher->prime(object => $object, message => get); + # Do other things + print $fetcher->get(object => $object, message => get), "\n"; + +=head1 SUBROUTINES/METHODS + +=head2 new + +Creates a Data::Fetch object. Takes no argument. + +=cut + sub new { my $proto = shift; my $class = ref($proto) || $proto; @@ -15,6 +45,15 @@ sub new { return bless {}, $class; } +=head2 prime + +Say what is is you'll be needing later. Takes two mandatory parameters: + +object - the object you'll be sending the message to +message - the message you'll be sending + +=cut + sub prime { my $self = shift; my %args = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_; @@ -35,6 +74,15 @@ sub prime { }); } +=head2 prime + +Say get a value you've primed. Takes two mandatory parameters: + +object - the object you'll be sending the message to +message - the message you'll be sending + +=cut + sub get { my $self = shift; my %args = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_; @@ -54,4 +102,57 @@ sub get { die "Need to prime before getting"; } -1; +=head1 AUTHOR + +Nigel Horne, C<< >> + +=head1 BUGS + +Can't give arguments to the message. + +Please report any bugs or feature requests to C, +or through the web interface at +L. +I will be notified, and then you'll +automatically be notified of progress on your bug as I make changes. + +=head1 SEE ALSO + +=head1 SUPPORT + +You can find documentation for this module with the perldoc command. + + perldoc Data::Fetch + + +You can also look for information at: + +=over 4 + +=item * RT: CPAN's request tracker + +L + +=item * AnnoCPAN: Annotated CPAN documentation + +L + +=item * CPAN Ratings + +L + +=item * Search CPAN + +L + +=back + +=head1 LICENSE AND COPYRIGHT + +Copyright 2016 Nigel Horne. + +This program is released under the following licence: GPL + +=cut + +1; # End of Data::Fetch