Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #161 from robertboloc/patch-1
Browse files Browse the repository at this point in the history
Syntax highlight fixes for the Events page
  • Loading branch information
bakura10 committed Apr 18, 2015
2 parents dbb574a + 63ecab0 commit 97e16e9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/6.Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ gains the following capabilities;
Configuration options are passed by the plugin manager to the constructor of an worker strategy. Setter methods will be
called for each option. If a setter does not exist an exception will be thrown.

```
```php
'SlmQueue\Strategy\MaxRunStrategy' => array('max_runs' => 10);
```
Such a config will result in an MaxRunStrategy instance of which the setMaxRuns method is called with '10'.

Expand All @@ -54,7 +53,7 @@ thereafter removed from the passed options. This means a Worker Strategy cannot
Worker strategies may inform the worker to stop processing the queue. Or more concrete; invalidate the condition of
the while loop.

```
```php
public function onSomeListener(WorkerEvent $event)
{
$event->exitWorkerLoop();
Expand All @@ -67,7 +66,7 @@ public function onSomeListener(WorkerEvent $event)
While processing a queue it might be required to execute some setup- or teardown logic. A worker strategy may listen to
the `bootstrap` and/or `finish` event to do just this.

```
```php
/**
* @param EventManagerInterface $events
*/
Expand Down Expand Up @@ -106,7 +105,7 @@ For some types of jobs it might be required to do something before or after the

This can be done by listening to the `process` event at different priorities.

```
```php
/**
* @param EventManagerInterface $events
*/
Expand Down Expand Up @@ -148,7 +147,7 @@ the `WorkerEvent::EVENT_PROCESS_STATE` is received.

From the MaxRunStrategy;

```
```php
public function onSomeListener(WorkerEvent $event)
{
$this->runCount++;
Expand All @@ -169,7 +168,7 @@ A worker strategy may ask the worker to dispatch events.

From the ProcessQueueStrategy

```
```php
public function onJobPop(WorkerEvent $e)
{
$queue = $e->getQueue();
Expand Down

0 comments on commit 97e16e9

Please sign in to comment.