Skip to content

Commit

Permalink
Move to POD style
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 14, 2016
1 parent 51eafe2 commit 43716dc
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
103 changes: 102 additions & 1 deletion lib/Data/Fetch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]} : @_;
Expand All @@ -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]} : @_;
Expand All @@ -54,4 +102,57 @@ sub get {
die "Need to prime before getting";
}

1;
=head1 AUTHOR
Nigel Horne, C<< <njh at bandsman.co.uk> >>
=head1 BUGS
Can't give arguments to the message.
Please report any bugs or feature requests to C<bug-data-fetch at rt.cpan.org>,
or through the web interface at
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Fetch>.
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<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Fetch>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Data-Fetch>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/Data-Fetch>
=item * Search CPAN
L<http://search.cpan.org/dist/Data-Fetch/>
=back
=head1 LICENSE AND COPYRIGHT
Copyright 2016 Nigel Horne.
This program is released under the following licence: GPL
=cut

1; # End of Data::Fetch

0 comments on commit 43716dc

Please sign in to comment.