From 8db2de2fc739a60533699d85b4e3df6e11c57047 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Thu, 26 Jul 2018 10:40:28 -0500 Subject: [PATCH 1/2] Add setup-worker; Update README --- README.md | 11 +++++++---- example/bin/setup-worker.php | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 example/bin/setup-worker.php diff --git a/README.md b/README.md index ef378715..9fc549f4 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,12 @@ A distributed task manager. * Status system. * Distributed IPC. + +### Setting up a Worker. +`example/bin/setup-worker.php` + ### Example usage ```bash -$ bin/kojo process:pool:server:start $PWD/example -``` - -### Setting up a Worker. \ No newline at end of file +$ cd example +$ vendor/bin/kojo process:pool:server:start $PWD/src/V1/Environment +``` \ No newline at end of file diff --git a/example/bin/setup-worker.php b/example/bin/setup-worker.php new file mode 100644 index 00000000..11ae4f27 --- /dev/null +++ b/example/bin/setup-worker.php @@ -0,0 +1,24 @@ +name('*.yml'); +$finder->files()->in($discoverableDirectories); +$jobCreator = (new Job\Type\Service())->addYmlServiceFinder($finder)->getNewJobTypeRegistrar(); +$jobCreator->setCode('protean_dlcp_example') + ->setWorkerClassUri('\Neighborhoods\KojoExample\V1\Worker\Facade') + ->setWorkerMethod('work') + ->setName('Protean DLCP Example') + ->setCronExpression('* * * * *') + ->setCanWorkInParallel(true) + ->setDefaultImportance(10) + ->setScheduleLimit(10) + ->setScheduleLimitAllowance(1) + ->setIsEnabled(true) + ->setAutoCompleteSuccess(false) + ->setAutoDeleteIntervalDuration('PT0S'); +$jobCreator->save(); \ No newline at end of file From 1f506bfecb8ca435743485eedc7bf2af8a1d927f Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Thu, 26 Jul 2018 11:12:36 -0500 Subject: [PATCH 2/2] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..53cb93d0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Neighborhoods.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.