Skip to content

Commit fab4dc3

Browse files
author
vcorre
committed
Update documentation
1 parent 8bc764e commit fab4dc3

File tree

10 files changed

+115
-202
lines changed

10 files changed

+115
-202
lines changed

README.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## LeezyPheanstalkBundle
1+
## PheanstalkBundle
22

33
[![Packagist Version](https://img.shields.io/packagist/v/pyrowman/pheanstalk-bundle)](https://packagist.org/packages/pyrowman/pheanstalk-bundle)
44
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/PyRowMan/pheanstalk-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PyRowMan/pheanstalk-bundle/?branch=master)
@@ -7,12 +7,12 @@
77

88
[EvQueue workqueue](http://www.evqueue.net/) clients for Symfony3.
99

10-
The Pyrowman\LeezyPheanstalkBundle is a fork from [LeezyPheanstalkBundle](https://github.com/armetiz/LeezyPheanstalkBundle)
10+
The Pyrowman\PheanstalkBundle is a fork from [LeezyPheanstalkBundle](https://github.com/armetiz/LeezyPheanstalkBundle)
1111

12-
The Pyrowman\LeezyPheanstalkBundle is a Symfony3 Bundle that provides a [pheanstalk](https://github.com/pyrowman/pheanstalk) integration with the following features:
12+
The Pyrowman\PheanstalkBundle is a Symfony3 Bundle that provides a [pheanstalk](https://github.com/pyrowman/pheanstalk) integration with the following features:
1313
* Command Line Interface for manage the queues.
1414
* An integration to the Symfony3 event system.
15-
* An integration to the Symfony3 profiler system to monitor your beanstalk server.
15+
* An integration to the Symfony3 profiler system to monitor your evqueue server.
1616
* An integration to the Symfony3 logger system.
1717
* A proxy system to customize the command features.
1818
* Auto-wiring: `PheanstalkInterface`
@@ -24,8 +24,6 @@ Documentation :
2424
- [CLI Usage](https://github.com/PyRowMan/pheanstalk-bundle/blob/master/src/Resources/doc/3-cli.md)
2525
- [Events](https://github.com/PyRowMan/pheanstalk-bundle/blob/master/src/Resources/doc/4-events.md)
2626
- [Custom proxy](https://github.com/PyRowMan/pheanstalk-bundle/blob/master/src/Resources/doc/5-custom-proxy.md)
27-
- [Extra - Beanstalk Manager](https://github.com/PyRowMan/pheanstalk-bundle/blob/master/src/Resources/doc/6-extra-beanstalk-manager.md)
28-
- [Extra - Proxy to prefix tubes](https://github.com/h4cc/LeezyPheanstalkBundleExtra)
2927

3028
## Usage example
3129

@@ -34,15 +32,20 @@ Documentation :
3432

3533
namespace Acme\DemoBundle\Controller;
3634

37-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
35+
use Pheanstalk\Structure\Schedule;
36+
use Pheanstalk\Structure\TimeSchedule;
37+
use Pyrowman\PheanstalkBundle\Proxy\PheanstalkProxy;
38+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
39+
use Symfony\Component\DependencyInjection\ContainerInterface;
3840

39-
class HomeController extends Controller {
41+
class HomeController extends AbstractController
42+
{
4043

4144
public function indexAction() {
4245

4346
$sc = $this->get('service_container');
4447
/** @var PheanstalkProxy $pheanstalk */
45-
$pheanstalk = $sc->get("leezy.pheanstalk");
48+
$pheanstalk = $sc->get("pheanstalk");
4649

4750
// Create a simple Worflow with one task inside
4851

@@ -59,8 +62,8 @@ class HomeController extends Controller {
5962

6063
//-----------------------------------------
6164
// Add a scheduler for the job (by default in continous)
62-
63-
$workflowSchedule = $pheanstalk->createSchedule($workflow, new TimeSchedule());
65+
$schedule = new Schedule($workflow->getId(), new TimeSchedule());
66+
$workflowSchedule = $pheanstalk->createSchedule($schedule);
6467

6568
//-----------------------------------------
6669
// Edit a workflow
@@ -97,8 +100,21 @@ class HomeController extends Controller {
97100
## Testing
98101

99102
```bash
100-
$ php composer.phar update
101-
$ phpunit
103+
# ensure you have Composer set up
104+
$ wget http://getcomposer.org/composer.phar
105+
$ php composer.phar install
106+
107+
$ bin/phpunit
108+
PHPUnit 7.1.2 by Sebastian Bergmann and contributors.
109+
110+
.......................................................... 58 / 58 (100%)
111+
112+
Time: 11.36 seconds, Memory: 16.00 MB
113+
114+
OK (58 tests, 98 assertions)
115+
116+
Generating code coverage report in HTML format ... done
117+
102118
```
103119

104120
## License

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<!--<log type="junit" target="build/logs/junit.xml"/>-->
1010
</logging>
1111
<testsuites>
12-
<testsuite name="LeezyPheanstalkBundle test suite">
12+
<testsuite name="PheanstalkBundle test suite">
1313
<directory suffix="Test.php">./tests</directory>
1414
</testsuite>
1515
</testsuites>

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getConfigTreeBuilder()
3939
->end()
4040
->scalarNode('port')
4141
->cannotBeEmpty()
42-
->defaultValue('11300')
42+
->defaultValue('5000')
4343
->end()
4444
->scalarNode('user')
4545
->cannotBeEmpty()

src/Resources/doc/1-installation.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
Installation is a quick 3 step process:
44

5-
1. Download LeezyPheanstalkBundle using composer
5+
1. Download PheanstalkBundle using composer
66
2. Enable the Bundle
77
3. Configure your application's config.yml
88

9-
### Step 1: Require LeezyPheanstalkBundle
9+
### Step 1: Require PheanstalkBundle
1010

1111
Tell composer to require this bundle by running:
1212

1313
``` bash
14-
$ composer require leezy/pheanstalk-bundle
14+
$ composer require pyrowman/pheanstalk-bundle
1515
```
1616

1717
### Step 2: Enable the bundle
@@ -26,7 +26,7 @@ public function registerBundles()
2626
{
2727
$bundles = array(
2828
// ...
29-
new Leezy\PheanstalkBundle\LeezyPheanstalkBundle(),
29+
new Pyrowman\PheanstalkBundle\PheanstalkBundle(),
3030
);
3131
}
3232
```
@@ -37,9 +37,11 @@ Finally, add the following to your config.yml
3737

3838
``` yaml
3939
# app/config/config.yml
40-
leezy_pheanstalk:
40+
pheanstalk:
4141
pheanstalks:
4242
primary:
43-
server: beanstalkd.domain.tld
43+
server: evqueue.domain.tld
44+
user: my_awesome_login_from_env_file
45+
password: my_awesome_password_from_env_file
4446
default: true
4547
```

src/Resources/doc/2-configuration.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,57 @@
33
This bundle can be configured, and this is the list of what you can do :
44
* Create many pheanstalk client.
55
* Define specific server / host for each connection.
6-
* Define specific port for each connection. This option is optional and default value is 11300.
6+
* Define specific port for each connection. This option is optional and default value is 5000.
77
* Define specific timeout for each connection. Timeout refere to the connection timeout. This option is optional and default value is 60.
88
* Use custom proxy for pheanstalk client.
99
* Disable this bundle. This options is optional and default value is true.
1010

1111
``` yaml
1212
# app/config/config.yml
13-
leezy_pheanstalk:
13+
pheanstalk:
1414
pheanstalks:
1515
primary:
16-
server: beanstalkd.domain.tld
16+
server: evqueue.domain.tld
17+
user: my_awesome_login_from_env_file
18+
password: my_awesome_password_from_env_file
1719
port: 11300
1820
timeout: 60
1921
secondary:
20-
server: beanstalkd-2.domain.tld
22+
server: evqueue-2.domain.tld
23+
user: my_awesome_login_from_env_file
24+
password: my_awesome_password_from_env_file
2125
default: true
2226
proxy: acme.pheanstalk
2327
profiler:
2428
enabled: true
25-
template: 'LeezyPheanstalkBundle:Profiler:pheanstalk.html.twig'
29+
template: 'PheanstalkBundle:Profiler:pheanstalk.html.twig'
2630
```
2731
28-
*acme.pheanstalk* is a custom proxy which implements the *Leezy\PheanstalkBundle\Proxy\PheanstalkProxyInterface* interface.
32+
*acme.pheanstalk* is a custom proxy which implements the *PyRowMan\PheanstalkBundle\Proxy\PheanstalkProxyInterface* interface.
2933
3034
**Note:**
3135
```
32-
You can retreive each pheanstalk using the container with "leezy.pheanstalk.[pheanstalk_name]".
33-
When you define a "default" pheanstalk. You can have a direct access to it with "leezy.pheanstalk".
36+
You can retreive each pheanstalk using the container with "pheanstalk.[pheanstalk_name]".
37+
When you define a "default" pheanstalk. You can have a direct access to it with "pheanstalk".
3438
```
3539

36-
``` php
40+
```php
3741
<?php
3842

3943
namespace Acme\DemoBundle\Controller;
4044

41-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
45+
use Pheanstalk\Structure\Schedule;
46+
use Pheanstalk\Structure\TimeSchedule;
47+
use Pyrowman\PheanstalkBundle\Proxy\PheanstalkProxy;
48+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
49+
use Symfony\Component\DependencyInjection\ContainerInterface;
4250

43-
class HomeController extends Controller
51+
class HomeController extends AbstractController
4452
{
4553
public function indexAction()
4654
{
47-
$pheanstalkPrimary = $this->get("leezy.pheanstalk.primary");
48-
$pheanstalkSecondary = $this->get("leezy.pheanstalk");
55+
$pheanstalkPrimary = $this->get("pheanstalk.primary");
56+
$pheanstalkSecondary = $this->get("pheanstalk");
4957

5058
// ----------------------------------------
5159
// producer (queues jobs) on beanstalk.domain.tld
@@ -68,7 +76,7 @@ class HomeController extends Controller
6876

6977
// ----------------------------------------
7078
// on each defined pheanstalks
71-
$pheanstalkLocator = $this->get("leezy.pheanstalk.pheanstalk_locator");
79+
$pheanstalkLocator = $this->get("pheanstalk.pheanstalk_locator");
7280

7381
foreach ($pheanstalkLocator->getPheanstalks() as $pheanstalk) {
7482
$pheanstalk

src/Resources/doc/3-cli.md

Lines changed: 6 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,19 @@
1-
## LeezyPheanstalkBundle Command Line Tools
1+
## PheanstalkBundle Command Line Tools
22

3-
The LeezyPheanstalkBundle provides a number of command line utilities.
3+
The PheanstalkBundle provides a number of command line utilities.
44
Commands are available for the following tasks:
55

6-
1. Delete a job.
7-
2. Flush a tube.
8-
3. List available tubes.
9-
4. Pause a tube.
10-
5. Peek a tube to get the first ready/burried job and associated data.
11-
6. Peek a job and get associated data.
12-
7. Put a new job in a tube.
13-
8. Get statistics about beanstalkd server.
14-
9. Get statistics about a job.
15-
10. Get statistics about a tube.
16-
11. Get next ready job.
6+
1. Delete a workflow.
177

188
**Note:**
199

2010
```
21-
You must have correctly installed and configured the LeezyPheanstalkBundle before using
11+
You must have correctly installed and configured the PheanstalkBundle before using
2212
these commands.
2313
```
2414

25-
### Delete a job
15+
### Delete a workflow
2616

2717
``` bash
28-
$ php app/console leezy:pheanstalk:delete-job 42
18+
$ php app/console pyrowman:pheanstalk:delete-workflow testname testgroup
2919
```
30-
31-
### Flush a tube.
32-
33-
``` bash
34-
$ php app/console leezy:pheanstalk:flush-tube your-tube
35-
```
36-
37-
**Note:**
38-
39-
```
40-
When you flush a tube, it will be removed from the beanstalkd server.
41-
```
42-
43-
### List available tubes.
44-
45-
``` bash
46-
$ php app/console leezy:pheanstalk:list-tube
47-
```
48-
49-
**Note:**
50-
51-
```
52-
Tubes that are display contains at least one job.
53-
```
54-
55-
### Pause a tube.
56-
57-
``` bash
58-
$ php app/console leezy:pheanstalk:pause-tube your-tube
59-
```
60-
61-
### Peek a tube to get the first ready job and associated data.
62-
63-
``` bash
64-
$ php app/console leezy:pheanstalk:peek-tube your-tube
65-
```
66-
67-
### Peek a tube to get the first burried job and associated data.
68-
69-
``` bash
70-
$ php app/console leezy:pheanstalk:peek-tube -b your-tube
71-
```
72-
73-
### Peek a job and get associated data.
74-
75-
``` bash
76-
$ php app/console leezy:pheanstalk:peek 42
77-
```
78-
79-
### Put a new job in a tube.
80-
81-
``` bash
82-
$ php app/console leezy:pheanstalk:put your-tube "Hello world - I am a job"
83-
```
84-
85-
### Get statistics about beanstalkd server.
86-
87-
``` bash
88-
$ php app/console leezy:pheanstalk:stats
89-
```
90-
91-
### Get statistics about a job.
92-
93-
``` bash
94-
$ php app/console leezy:pheanstalk:stats-job 42
95-
```
96-
97-
### Get statistics about a tube.
98-
99-
``` bash
100-
$ php app/console leezy:pheanstalk:stats-tube your-tube
101-
```
102-
103-
### Get next ready job.
104-
105-
``` bash
106-
$ php app/console leezy:pheanstalk:next-ready your-tube --details
107-
```

0 commit comments

Comments
 (0)