Skip to content

Commit

Permalink
Merge pull request #15 from neighborhoods/master
Browse files Browse the repository at this point in the history
Update README and setup worker example worker installer.
  • Loading branch information
rhift authored Jul 26, 2018
2 parents 89d4a8a + 301dd8a commit c6aec7e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,29 @@ A distributed task manager.
* Status system.
* Distributed IPC.

### Install Kōjō
```bash
$ cd example
$ vendor/bin/kojo db:setup:install $PWD/src/V1/Environment
```

### Setting up a Worker.
`example/bin/setup-worker.php`
```bash
$ cd example
$ php bin/setup-worker.php
```

### Example usage
Change `https://sqs.us-east-1.amazonaws.com/272157948465/local-bwilson` in `example/src` and `example/bin/create-messages.php` to your favorite SQS queue.

```bash
$ cd example
$ php bin/create-messages.php
$ vendor/bin/kojo process:pool:server:start $PWD/src/V1/Environment
```

### Uninstall Kōjō
```bash
$ cd example
$ vendor/bin/kojo db:tear_down:uninstall $PWD/src/V1/Environment
```
5 changes: 4 additions & 1 deletion example/bin/setup-worker.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php
declare(strict_types=1);
error_reporting(E_ALL);

require_once __DIR__ . '/../vendor/autoload.php';

use Symfony\Component\Finder\Finder;
use Neighborhoods\Kojo\Api\V1\Job;

$discoverableDirectories[] = __DIR__ . '/../../../V1';
$discoverableDirectories[] = __DIR__ . '/../src/V1/Environment';
$finder = new Finder();
$finder->name('*.yml');
$finder->files()->in($discoverableDirectories);
Expand Down

0 comments on commit c6aec7e

Please sign in to comment.