Skip to content

Commit 79674ac

Browse files
authored
Merge pull request #38 from atoomic/readme
Regenerate README.md with colors
2 parents ff7b5f5 + 2f9cdaf commit 79674ac

3 files changed

Lines changed: 30 additions & 22 deletions

File tree

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012.
1+
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.017.
22
use strict;
33
use warnings;
44

README.mkdn renamed to README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
[![Build Status](https://travis-ci.org/CpanelInc/cPanel-TaskQueue.png?branch=master)](https://travis-ci.org/CpanelInc/cPanel-TaskQueue)
2-
31
# NAME
42

53
cPanel::TaskQueue - FIFO queue of tasks to perform
64

75
# SYNOPSIS
86

9-
use cPanel::TaskQueue ();
7+
```perl
8+
use cPanel::TaskQueue ();
109

11-
my $queue = cPanel::TaskQueue->new( { name => 'tasks', state_dir => "/home/$user/.cpanel/queue" } );
10+
my $queue = cPanel::TaskQueue->new( { name => 'tasks', state_dir => "/home/$user/.cpanel/queue" } );
1211

13-
$queue->queue_task( "init_quota" );
14-
$queue->queue_task( "edit_quota fred 0" );
15-
$queue->queue_tasks( "init_quota", "edit_quota fred 0" );
12+
$queue->queue_task( "init_quota" );
13+
$queue->queue_task( "edit_quota fred 0" );
14+
$queue->queue_tasks( "init_quota", "edit_quota fred 0" );
1615

17-
# Processing loop
18-
while (1) {
19-
# if work, process, else sleep
20-
if ( $queue->has_work_to_do() ) {
21-
eval { $queue->process_next_task() };
22-
if ( $@ ) {
23-
Carp::carp( $@ );
24-
}
25-
}
26-
else {
27-
# wait for work.
28-
sleep 300;
16+
# Processing loop
17+
while (1) {
18+
# if work, process, else sleep
19+
if ( $queue->has_work_to_do() ) {
20+
eval { $queue->process_next_task() };
21+
if ( $@ ) {
22+
Carp::carp( $@ );
2923
}
3024
}
25+
else {
26+
# wait for work.
27+
sleep 300;
28+
}
29+
}
30+
```
3131

3232
# DESCRIPTION
3333

@@ -392,7 +392,9 @@ us.
392392
To provide a different method of logging/reporting, supply an object to do the
393393
logging as follows when `use`ing the module.
394394

395-
use cPanel::TaskQueue ( '-logger' => $logger );
395+
```perl
396+
use cPanel::TaskQueue ( '-logger' => $logger );
397+
```
396398

397399
The supplied object should supply (at least) 4 methods: `throw`, `warn`,
398400
`info`, and `notify`. When needed these methods will be called with the
@@ -404,7 +406,7 @@ multiple modules and expect it to work.
404406
In addition to setting a global logger, a new logger object can be supplied
405407
when creating a specific `TaskQueue` object.
406408

407-
See [cPanel::TaskQueue::Cookbook](https://metacpan.org/pod/cPanel::TaskQueue::Cookbook) for examples.
409+
See [cPanel::TaskQueue::Cookbook](https://metacpan.org/pod/cPanel%3A%3ATaskQueue%3A%3ACookbook) for examples.
408410

409411
# DIAGNOSTICS
410412

dist.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ repository.type = git
4545
; very useful so Travis CI can use it without installing Dist::Zilla::*
4646
run = cp %d/Makefile.PL ./
4747
run = git status --porcelain | grep 'M Makefile.PL' && git commit -m 'Makefile.PL auto-updated by dist.ini' Makefile.PL && echo "# Makefile.PL auto-update" || echo "# Makefile.PL up to date"
48+
49+
[ReadmeAnyFromPod / Markdown_Readme]
50+
type = gfm
51+
source_filename = lib/cPanel/TaskQueue.pm
52+
filename = README.md
53+
location = root

0 commit comments

Comments
 (0)