Skip to content

Commit 2e1df6e

Browse files
committed
Added Readme/Installation instructions.
Corrected schema file for installation.
1 parent b0af0ad commit 2e1df6e

File tree

3 files changed

+94
-67
lines changed

3 files changed

+94
-67
lines changed

README

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--------------------------------
2+
CakePHP Queue Plugin
3+
--------------------------------
4+
5+
Installation:
6+
--------------------------------
7+
* Copy the files in this directory into <yourapp>/plugins/queue.
8+
* Run the following command in the cake console to create the tables:
9+
cake schema run create -path plugins\queue\config\sql -name queue
10+
11+
Usage:
12+
--------------------------------
13+
cake queue help
14+
-> Display Help message
15+
cake queue add <taskname>
16+
-> Try to call the cli add() function on a task
17+
-> tasks may or may not provide this functionality.
18+
cake queue runworker
19+
-> run a queue worker, which will look for a pending task it can execute.
20+
-> the worker will always try to find jobs matching its installed Tasks
21+
Notes:
22+
<taskname> may either be the complete classname (eg. queue_example)
23+
or the shorthand without the leading "queue_" (eg. example)
24+
25+
Use 'cake queue help' to get a list of installed/available tasks.
26+
27+
Custom tasks should be placed in <yourapp>/vendors/shells/tasks.
28+
Tasks should be named 'queue_something.php' and implement a "queueSomethingTask", keeping Cakephp Naming conventions intact.
29+
30+
A detailed Example task can be found in /vendors/shells/tasks/queue_example.php inside this folder.

config/sql/queue.php

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?php
2+
3+
/**
4+
5+
* @package QueuePlugin
6+
* @subpackage QueuePlugin.Models
7+
*/
8+
class queueSchema extends CakeSchema {
9+
var $name = 'queue';
10+
11+
function before($event = array()) {
12+
return true;
13+
}
14+
15+
function after($event = array()) {
16+
}
17+
18+
public $queued_tasks = array(
19+
'id' => array(
20+
'type' => 'integer',
21+
'null' => false,
22+
'default' => NULL,
23+
'length' => 10,
24+
'key' => 'primary'
25+
),
26+
'jobtype' => array(
27+
'type' => 'string',
28+
'null' => false,
29+
'length' => 45
30+
),
31+
'data' => array(
32+
'type' => 'text',
33+
'null' => true,
34+
'default' => NULL
35+
),
36+
'created' => array(
37+
'type' => 'datetime',
38+
'null' => false
39+
),
40+
'fetched' => array(
41+
'type' => 'datetime',
42+
'null' => true,
43+
'default' => NULL
44+
),
45+
'completed' => array(
46+
'type' => 'datetime',
47+
'null' => true,
48+
'default' => NULL
49+
),
50+
'failed' => array(
51+
'type' => 'integer',
52+
'null' => false,
53+
'default' => '0',
54+
'length' => 3
55+
),
56+
'indexes' => array(
57+
'PRIMARY' => array(
58+
'column' => 'id',
59+
'unique' => 1
60+
)
61+
)
62+
);
63+
}
64+
?>

config/sql/schema.php

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)