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. 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