From 15c7f118df2ddb2ca45429ad97d93fafc9219018 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Thu, 1 Feb 2018 16:46:07 -0600 Subject: [PATCH 01/44] Proc UUIDs, DI term signals, DI max LA, redis mutex framework, minor change to time model - %.06f > %f for time - setTerminationSignalNumber - setUuidMaximumInteger - setMaximumLoadAverage - redis mutex - process UUIDs - DI termination signal numbers - max LA DI - redis mutex process --- nhdstoolkitsrc/Time.php | 4 +- src/Process/Collection.php | 3 +- src/Process/Mutex/Redis.php | 21 +++++++++ src/Process/Pool.php | 12 ++--- src/Process/Pool/StrategyAbstract.php | 17 ++++--- src/Process/Pool/StrategyInterface.php | 11 +++++ src/Process/PoolAbstract.php | 8 ++-- src/Process/PoolInterface.php | 2 +- src/ProcessAbstract.php | 59 ++++++++++++++++++++++--- src/ProcessInterface.php | 24 ++++++++++ src/Semaphore/Mutex/Redis.php | 25 +++++++++++ src/Semaphore/Mutex/RedisInterface.php | 10 +++++ src/config/Process/Job.yml | 2 + src/config/Process/Job/Required.yml | 2 + src/config/Process/Listener/Command.yml | 2 + src/config/Process/Pool/Server.yml | 2 + src/config/Process/Pool/Strategy.yml | 5 +++ src/config/Process/Root.yml | 2 + 18 files changed, 183 insertions(+), 28 deletions(-) create mode 100644 src/Process/Mutex/Redis.php create mode 100644 src/Semaphore/Mutex/Redis.php create mode 100644 src/Semaphore/Mutex/RedisInterface.php diff --git a/nhdstoolkitsrc/Time.php b/nhdstoolkitsrc/Time.php index a8ddefba..db4a465e 100644 --- a/nhdstoolkitsrc/Time.php +++ b/nhdstoolkitsrc/Time.php @@ -9,7 +9,7 @@ class Time implements TimeInterface public function getNow(string $timezoneCode = self::DEFAULT_TIMEZONE_CODE): \DateTime { - $microTime = explode('.', sprintf('%.06f', microtime(true))); + $microTime = explode('.', sprintf('%f', microtime(true))); $time = gmdate(self::MYSQL_DATE_TIME_FORMAT . '.' . $microTime[1], (int) $microTime[0]); $now = new \DateTime($time, new \DateTimeZone('GMT')); $now->setTimezone($this->getDateTimeZone($timezoneCode)); @@ -19,7 +19,7 @@ public function getNow(string $timezoneCode = self::DEFAULT_TIMEZONE_CODE): \Dat public function getUnixReferenceTimeNow(): string { - return sprintf('%.06f', microtime(true)); + return sprintf('%f', microtime(true)); } public function validateTimestamp(string $timestamp, string $format = TimeInterface::MYSQL_DATE_TIME_FORMAT): bool diff --git a/src/Process/Collection.php b/src/Process/Collection.php index 34a09b46..4ac0b514 100644 --- a/src/Process/Collection.php +++ b/src/Process/Collection.php @@ -52,7 +52,8 @@ public function applyProcessPool(PoolInterface $pool): CollectionInterface /** @var ProcessInterface $processPrototype */ foreach ($this->_processPrototypes as $processPrototype) { $processPrototype->setProcessPool($pool); - $processPrototype->setParentProcessPath($pool->getProcessPath()); + $processPrototype->setParentProcessPath($pool->getProcess()->getPath()); + $processPrototype->setParentProcessUuid($pool->getProcess()->getUuid()); } return $this; diff --git a/src/Process/Mutex/Redis.php b/src/Process/Mutex/Redis.php new file mode 100644 index 00000000..19dfbf1f --- /dev/null +++ b/src/Process/Mutex/Redis.php @@ -0,0 +1,21 @@ +_register(); + return $this; + } + + protected function _register() + { + + } +} \ No newline at end of file diff --git a/src/Process/Pool.php b/src/Process/Pool.php index af95b58b..4d792286 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -99,7 +99,7 @@ public function addChildProcess(ProcessInterface $childProcess): PoolInterface public function getChildProcess(int $childProcessId): ProcessInterface { if (!isset($this->_childProcesses[$childProcessId])) { - throw new \LogicException("Process is with process ID $childProcessId not set."); + throw new \LogicException("Process is with process ID [$childProcessId] not set."); } return $this->_childProcesses[$childProcessId]; @@ -131,14 +131,10 @@ public function terminateChildProcesses(): PoolInterface /** @var ProcessInterface $process */ foreach ($this->_childProcesses as $process) { $processId = $process->getProcessId(); + $terminationSignalNumber = $process->getTerminationSignalNumber(); $processTypeCode = $process->getTypeCode(); - if ($process instanceof ListenerInterface) { - posix_kill($processId, SIGKILL); - $this->_getLogger()->debug("Sent SIGKILL to Process[$processId][$processTypeCode]."); - }else { - posix_kill($processId, SIGTERM); - $this->_getLogger()->debug("Sent SIGTERM to Process[$processId][$processTypeCode]."); - } + posix_kill($processId, $terminationSignalNumber); + $this->_getLogger()->debug("Sent SIGKILL to Process[$processId][$processTypeCode]."); unset($this->_childProcesses[$processId]); } } diff --git a/src/Process/Pool/StrategyAbstract.php b/src/Process/Pool/StrategyAbstract.php index a6992f43..c54884e3 100644 --- a/src/Process/Pool/StrategyAbstract.php +++ b/src/Process/Pool/StrategyAbstract.php @@ -12,11 +12,6 @@ abstract class StrategyAbstract implements StrategyInterface use Strict\AwareTrait; use Logger\AwareTrait; use Collection\AwareTrait; - const PROP_MAX_ALARM_TIME = 'max_alarm_time'; - const PROP_CHILD_PROCESS_WAIT_THROTTLE = 'child_process_wait_throttle'; - const PROP_MAX_CHILD_PROCESSES = 'max_child_processes'; - const PROP_ALARM_PROCESS_TYPE_CODE = 'alarm_process_type_code'; - const PROP_FILL_PROCESS_TYPE_CODE = 'fill_process_type_code'; public function setMaxAlarmTime(int $seconds): StrategyInterface { @@ -82,4 +77,16 @@ protected function _getFillProcessTypeCode(): string { return $this->_read(self::PROP_FILL_PROCESS_TYPE_CODE); } + + public function setMaximumLoadAverage(float $maximumLoadAverage): StrategyInterface + { + $this->_create(self::PROP_MAXIMUM_LOAD_AVERAGE, $maximumLoadAverage); + + return $this; + } + + public function getMaximumLoadAverage(): float + { + return $this->_read(self:: PROP_MAXIMUM_LOAD_AVERAGE); + } } \ No newline at end of file diff --git a/src/Process/Pool/StrategyInterface.php b/src/Process/Pool/StrategyInterface.php index 0fa9b309..708a4201 100644 --- a/src/Process/Pool/StrategyInterface.php +++ b/src/Process/Pool/StrategyInterface.php @@ -9,6 +9,13 @@ interface StrategyInterface { + const PROP_ALARM_PROCESS_TYPE_CODE = 'alarm_process_type_code'; + const PROP_MAX_ALARM_TIME = 'max_alarm_time'; + const PROP_FILL_PROCESS_TYPE_CODE = 'fill_process_type_code'; + const PROP_MAX_CHILD_PROCESSES = 'max_child_processes'; + const PROP_CHILD_PROCESS_WAIT_THROTTLE = 'child_process_wait_throttle'; + const PROP_MAXIMUM_LOAD_AVERAGE = 'maximum_load_average'; + public function setProcessPool(PoolInterface $pool); public function setProcessCollection(CollectionInterface $collection); @@ -36,4 +43,8 @@ public function currentPendingChildExitsCompleted(): StrategyInterface; public function setAlarmProcessTypeCode(string $alarmProcessTypeCode): StrategyInterface; public function setFillProcessTypeCode(string $fillProcessTypeCode): StrategyInterface; + + public function setMaximumLoadAverage(float $maximumLoadAverage): StrategyInterface; + + public function getMaximumLoadAverage(): float; } \ No newline at end of file diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index b9872781..acb81e03 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -4,6 +4,7 @@ namespace NHDS\Jobs\Process; use NHDS\Jobs\Process; +use NHDS\Jobs\ProcessInterface; use NHDS\Toolkit\Data\Property\Strict; abstract class PoolAbstract implements PoolInterface @@ -12,7 +13,6 @@ abstract class PoolAbstract implements PoolInterface use Process\Pool\Logger\AwareTrait; use Process\Pool\Strategy\AwareTrait; use Process\AwareTrait; - const MAX_LOAD_AVERAGE = 10.0; public function hasAlarm(): bool { @@ -40,7 +40,7 @@ public function isEmpty(): bool public function isFull(): bool { - if ((float)current(sys_getloadavg()) > self::MAX_LOAD_AVERAGE) { + if ((float)current(sys_getloadavg()) > $this->_getProcessPoolStrategy()->getMaximumLoadAverage()) { $isFull = true; }else { $maxChildProcesses = $this->_getProcessPoolStrategy()->getMaxChildProcesses(); @@ -81,8 +81,8 @@ protected function _validateAlarm(): PoolInterface return $this; } - public function getProcessPath(): string + public function getProcess(): ProcessInterface { - return $this->_getProcess()->getPath(); + return $this->_getProcess(); } } \ No newline at end of file diff --git a/src/Process/PoolInterface.php b/src/Process/PoolInterface.php index 9f37e3a9..49fce8d6 100644 --- a/src/Process/PoolInterface.php +++ b/src/Process/PoolInterface.php @@ -34,5 +34,5 @@ public function getCountOfChildProcesses(): int; public function setProcess(ProcessInterface $process); - public function getProcessPath(): string; + public function getProcess(): ProcessInterface; } \ No newline at end of file diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index aabb9244..17c639c2 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -13,13 +13,6 @@ abstract class ProcessAbstract implements ProcessInterface use Process\Strategy\AwareTrait; use Strict\AwareTrait; use Logger\AwareTrait; - const PROP_TYPE_CODE = 'type_code'; - const PROP_THROTTLE = 'throttle'; - const PROP_PROCESS_ID = 'process_id'; - const PROP_PARENT_PROCESS_ID = 'parent_process_id'; - const PROP_EXIT_CODE = 'exit_code'; - const PROP_PATH = 'path'; - const PROP_PARENT_PROCESS_PATH = 'parent_process_path'; protected function _initialize(int $processId = null): ProcessAbstract { @@ -130,6 +123,58 @@ public function receivedSignal() $this->_exit(0); } + public function setTerminationSignalNumber(int $terminationSignalNumber): ProcessInterface + { + $this->_create(self::PROP_TERMINATION_SIGNAL_NUMBER, $terminationSignalNumber); + + return $this; + } + + public function getTerminationSignalNumber(): int + { + return $this->_read(self::PROP_TERMINATION_SIGNAL_NUMBER); + } + + public function setParentProcessUuid(string $parentProcessUuid): ProcessInterface + { + $this->_create(self::PROP_PARENT_PROCESS_UUID, $parentProcessUuid); + + return $this; + } + + public function getParentProcessUuid(): string + { + return $this->_read(self::PROP_PARENT_PROCESS_UUID); + } + + public function getUuid(): string + { + if (!$this->_exists(self::PROP_UUID)) { + $hostname = gethostname(); + $processUuid = $hostname + . '-' . gethostbyname($hostname) + . '-' . $this->getPath() + . '-' . sprintf('%f', microtime(true)) + . '-' . random_int(0, $this->_getUuidMaximumInteger()); + $this->_create(self::PROP_UUID, $processUuid); + $this->_getLogger()->debug("Generated UUID[$processUuid]"); + } + + return $this->_read(self::PROP_UUID); + } + + public function setUuidMaximumInteger(int $uuidMaximumInteger): ProcessInterface + { + $this->_create(self::PROP_UUID_MAXIMUM_INTEGER, $uuidMaximumInteger); + + return $this; + } + + protected function _getUuidMaximumInteger(): int + { + return $this->_read(self::PROP_UUID_MAXIMUM_INTEGER); + } + protected function _exit(int $exitCode) { $this->_getLogger()->debug("Exiting Process."); diff --git a/src/ProcessInterface.php b/src/ProcessInterface.php index e54f3f04..12153daa 100644 --- a/src/ProcessInterface.php +++ b/src/ProcessInterface.php @@ -8,6 +8,18 @@ interface ProcessInterface { + const PROP_THROTTLE = 'throttle'; + const PROP_EXIT_CODE = 'exit_code'; + const PROP_PATH = 'path'; + const PROP_TERMINATION_SIGNAL_NUMBER = 'termination_signal_number'; + const PROP_PROCESS_ID = 'process_id'; + const PROP_PARENT_PROCESS_ID = 'parent_process_id'; + const PROP_TYPE_CODE = 'type_code'; + const PROP_PARENT_PROCESS_PATH = 'parent_process_path'; + const PROP_UUID = 'uuid'; + const PROP_UUID_MAXIMUM_INTEGER = 'uuid_maximum_integer'; + const PROP_PARENT_PROCESS_UUID = 'parent_process_uuid'; + public function start(): ProcessInterface; public function getProcessId(): int; @@ -33,4 +45,16 @@ public function receivedSignal(); public function setParentProcessPath(string $parentProcessPath): ProcessInterface; public function getPath(): string; + + public function setTerminationSignalNumber(int $terminationSignalNumber): ProcessInterface; + + public function getTerminationSignalNumber(): int; + + public function getUuid(): string; + + public function setUuidMaximumInteger(int $uuidMaximumInteger): ProcessInterface; + + public function setParentProcessUuid(string $parentProcessUuid): ProcessInterface; + + public function getParentProcessUuid(): string; } \ No newline at end of file diff --git a/src/Semaphore/Mutex/Redis.php b/src/Semaphore/Mutex/Redis.php new file mode 100644 index 00000000..89025d3d --- /dev/null +++ b/src/Semaphore/Mutex/Redis.php @@ -0,0 +1,25 @@ + Date: Fri, 2 Mar 2018 14:36:08 -0600 Subject: [PATCH 02/44] first commit - distributed process-aware redis mutex - other things - ty @aallon <3 --- composer.json | 5 +- composer.lock | 349 ++++++++++++++---- src/CacheItemPool/AwareTrait.php | 14 +- src/CacheItemPool/Factory.php | 15 + src/CacheItemPool/Factory/AwareTrait.php | 38 ++ src/CacheItemPool/FactoryInterface.php | 12 + src/CacheItemPool/Repository.php | 22 ++ src/CacheItemPool/Repository/AwareTrait.php | 38 ++ src/CacheItemPool/RepositoryInterface.php | 11 + src/Data/AutoSchedule/Sqs/AwareTrait.php | 2 +- src/Message/Broker/BrokerAbstract.php | 34 +- src/Message/Broker/BrokerInterface.php | 8 + src/Message/Broker/Redis.php | 7 - src/Message/Broker/Type/Collection.php | 2 +- src/Process/Collection.php | 2 + src/Process/Forkable.php | 42 --- src/Process/Forked.php | 64 ++++ src/Process/Job.php | 6 +- src/Process/Listener/Command.php | 4 +- src/Process/Listener/Mutex/Redis.php | 54 +++ src/Process/Listener/Mutex/RedisInterface.php | 10 + src/Process/ListenerAbstract.php | 2 +- src/Process/Mutex/Redis.php | 21 -- src/Process/Pool.php | 12 +- src/Process/Pool/Server.php | 7 +- src/Process/Pool/Strategy.php | 2 +- src/Process/Registry.php | 28 ++ src/Process/Registry/AwareTrait.php | 33 ++ src/Process/RegistryInterface.php | 13 + src/Process/Root.php | 14 +- src/ProcessAbstract.php | 33 +- src/ProcessInterface.php | 29 +- src/Redis/AwareTrait.php | 36 ++ src/Redis/Factory.php | 74 ++++ src/Redis/Factory/AwareTrait.php | 38 ++ src/Redis/FactoryInterface.php | 22 ++ src/Redis/Repository.php | 21 ++ src/Semaphore/Mutex/Redis.php | 110 +++++- src/bin/jobs | 4 +- src/bin/server | 4 +- src/config/Message/Broker/Redis.yml | 11 +- src/config/Message/Broker/Type/Collection.yml | 1 + src/config/Process/Collection.yml | 17 +- src/config/Process/Job.yml | 2 + src/config/Process/Job/Required.yml | 2 + src/config/Process/Listener/Command.yml | 4 +- src/config/Process/Listener/Mutex/Redis.yml | 19 + src/config/Process/Pool/Factory.yml | 36 +- src/config/Process/Pool/Logger.yml | 4 +- src/config/Process/Pool/Server.yml | 1 + src/config/Process/Pool/Strategy.yml | 13 +- src/config/Process/Registry.yml | 8 + src/config/Process/Root.yml | 1 + src/config/Redis/Factory.yml | 15 + src/config/Semaphore/Mutex/Redis.yml | 12 + src/config/Semaphore/Resource/Factory.yml | 10 +- src/config/dependencies.yml | 2 + src/config/root.yml | 14 +- tests/Unit/ForemanInterfaceTest.php | 2 +- tests/Unit/MaintainerInterfaceTest.php | 2 +- tests/Unit/Process/PooIInterfaceTest.php | 2 +- .../Unit/Process/Pool/ServerInterfaceTest.php | 2 +- tests/Unit/SchedulerInterfaceTest.php | 2 +- tests/Unit/SelectorInterfaceTest.php | 2 +- tests/Unit/SemaphoreInterfaceTest.php | 2 +- tests/Unit/Service/CreateInterfaceTest.php | 2 +- 66 files changed, 1211 insertions(+), 219 deletions(-) create mode 100644 src/CacheItemPool/Factory.php create mode 100644 src/CacheItemPool/Factory/AwareTrait.php create mode 100644 src/CacheItemPool/FactoryInterface.php create mode 100644 src/CacheItemPool/Repository.php create mode 100644 src/CacheItemPool/Repository/AwareTrait.php create mode 100644 src/CacheItemPool/RepositoryInterface.php delete mode 100644 src/Process/Forkable.php create mode 100644 src/Process/Forked.php create mode 100644 src/Process/Listener/Mutex/Redis.php create mode 100644 src/Process/Listener/Mutex/RedisInterface.php delete mode 100644 src/Process/Mutex/Redis.php create mode 100644 src/Process/Registry.php create mode 100644 src/Process/Registry/AwareTrait.php create mode 100644 src/Process/RegistryInterface.php create mode 100644 src/Redis/AwareTrait.php create mode 100644 src/Redis/Factory.php create mode 100644 src/Redis/Factory/AwareTrait.php create mode 100644 src/Redis/FactoryInterface.php create mode 100644 src/Redis/Repository.php create mode 100644 src/config/Process/Listener/Mutex/Redis.yml create mode 100644 src/config/Process/Registry.yml create mode 100644 src/config/Redis/Factory.yml create mode 100644 src/config/Semaphore/Mutex/Redis.yml diff --git a/composer.json b/composer.json index d6619f64..355d3f70 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "symfony/dependency-injection": "~4.0.3", "symfony/expression-language": "~4.0.3", "symfony/cache": "~4.0.3", - "symfony/console": "~4.0.3" + "symfony/console": "~4.0.3", + "ocramius/proxy-manager": "^2.1" }, "require-dev": { "phpunit/phpunit": "^6.4", @@ -40,7 +41,7 @@ "autoload-dev": { "psr-4": { "NHDS\\Jobs\\Test\\": "tests", - "NHDS\\Watch\\": "nhdswatchsrc", + "Neighborhoods\\Scaffolding\\": "nhdswatchsrc", "NHDS\\Jobs\\Example\\": "example" } } diff --git a/composer.lock b/composer.lock index 89914db6..0518af75 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "f7cf05b6dafa72c1ea53e8c6286187ec", + "content-hash": "616476aa0db15d2c2a5199087edf6922", "packages": [ { "name": "dragonmantank/cron-expression", @@ -55,6 +55,124 @@ ], "time": "2017-10-12T15:59:13+00:00" }, + { + "name": "ocramius/package-versions", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/4489d5002c49d55576fa0ba786f42dbb009be46f", + "reference": "4489d5002c49d55576fa0ba786f42dbb009be46f", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" + }, + "require-dev": { + "composer/composer": "^1.6.3", + "ext-zip": "*", + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "time": "2018-02-05T13:05:30+00:00" + }, + { + "name": "ocramius/proxy-manager", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/ProxyManager.git", + "reference": "e18ac876b2e4819c76349de8f78ccc8ef1554cd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/e18ac876b2e4819c76349de8f78ccc8ef1554cd7", + "reference": "e18ac876b2e4819c76349de8f78ccc8ef1554cd7", + "shasum": "" + }, + "require": { + "ocramius/package-versions": "^1.1.1", + "php": "^7.1.0", + "zendframework/zend-code": "^3.1.0" + }, + "require-dev": { + "couscous/couscous": "^1.5.2", + "ext-phar": "*", + "humbug/humbug": "dev-master@DEV", + "nikic/php-parser": "^3.0.4", + "phpbench/phpbench": "^0.12.2", + "phpstan/phpstan": "^0.6.4", + "phpunit/phpunit": "^5.6.4", + "phpunit/phpunit-mock-objects": "^3.4.1", + "squizlabs/php_codesniffer": "^2.7.0" + }, + "suggest": { + "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects", + "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)", + "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)", + "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "ProxyManager\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.io/" + } + ], + "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies", + "homepage": "https://github.com/Ocramius/ProxyManager", + "keywords": [ + "aop", + "lazy loading", + "proxy", + "proxy pattern", + "service proxies" + ], + "time": "2017-05-04T11:12:50+00:00" + }, { "name": "psr/cache", "version": "1.0.1", @@ -247,16 +365,16 @@ }, { "name": "symfony/cache", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "1ebe207de664355b1699d35b12b0563c38a47b4e" + "reference": "e901ff335ef5e8ef57ee9b8e098bd54a1d39a857" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/1ebe207de664355b1699d35b12b0563c38a47b4e", - "reference": "1ebe207de664355b1699d35b12b0563c38a47b4e", + "url": "https://api.github.com/repos/symfony/cache/zipball/e901ff335ef5e8ef57ee9b8e098bd54a1d39a857", + "reference": "e901ff335ef5e8ef57ee9b8e098bd54a1d39a857", "shasum": "" }, "require": { @@ -312,20 +430,20 @@ "caching", "psr6" ], - "time": "2018-01-03T17:15:19+00:00" + "time": "2018-01-18T22:19:33+00:00" }, { "name": "symfony/config", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "0e86d267db0851cf55f339c97df00d693fe8592f" + "reference": "ecd917899167922086ddb3247aa43eb1c418fcb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/0e86d267db0851cf55f339c97df00d693fe8592f", - "reference": "0e86d267db0851cf55f339c97df00d693fe8592f", + "url": "https://api.github.com/repos/symfony/config/zipball/ecd917899167922086ddb3247aa43eb1c418fcb2", + "reference": "ecd917899167922086ddb3247aa43eb1c418fcb2", "shasum": "" }, "require": { @@ -372,20 +490,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-01-21T19:06:11+00:00" }, { "name": "symfony/console", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e" + "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", - "reference": "fe0e69d7162cba0885791cf7eea5f0d7bc0f897e", + "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", + "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", "shasum": "" }, "require": { @@ -440,20 +558,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-01-29T09:06:29+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "67bf5e4f4da85624f30a5e43b7f43225c8b71959" + "reference": "f78ca49c6360c710ca8e316511e71a23b10e3bf2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/67bf5e4f4da85624f30a5e43b7f43225c8b71959", - "reference": "67bf5e4f4da85624f30a5e43b7f43225c8b71959", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f78ca49c6360c710ca8e316511e71a23b10e3bf2", + "reference": "f78ca49c6360c710ca8e316511e71a23b10e3bf2", "shasum": "" }, "require": { @@ -511,11 +629,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-01-04T15:52:56+00:00" + "time": "2018-01-29T09:29:16+00:00" }, { "name": "symfony/expression-language", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", @@ -565,7 +683,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -614,16 +732,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296" + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", - "reference": "2ec8b39c38cb16674bbf3fea2b6ce5bf117e1296", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", "shasum": "" }, "require": { @@ -635,7 +753,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.7-dev" } }, "autoload": { @@ -669,20 +787,20 @@ "portable", "shim" ], - "time": "2017-10-11T12:05:26+00:00" + "time": "2018-01-30T19:27:44+00:00" }, { "name": "symfony/yaml", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b84f646b9490d2101e2c25ddeec77ceefbda2eee" + "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b84f646b9490d2101e2c25ddeec77ceefbda2eee", - "reference": "b84f646b9490d2101e2c25ddeec77ceefbda2eee", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ffc60bda1d4a00ec0b32eeabf39dc017bf480028", + "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028", "shasum": "" }, "require": { @@ -727,7 +845,60 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-01-21T19:06:11+00:00" + }, + { + "name": "zendframework/zend-code", + "version": "3.3.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-code.git", + "reference": "6b1059db5b368db769e4392c6cb6cc139e56640d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-code/zipball/6b1059db5b368db769e4392c6cb6cc139e56640d", + "reference": "6b1059db5b368db769e4392c6cb6cc139e56640d", + "shasum": "" + }, + "require": { + "php": "^7.1", + "zendframework/zend-eventmanager": "^2.6 || ^3.0" + }, + "require-dev": { + "doctrine/annotations": "~1.0", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "zendframework/zend-coding-standard": "^1.0.0", + "zendframework/zend-stdlib": "^2.7 || ^3.0" + }, + "suggest": { + "doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features", + "zendframework/zend-stdlib": "Zend\\Stdlib component" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\Code\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "provides facilities to generate arbitrary code using an object oriented interface", + "homepage": "https://github.com/zendframework/zend-code", + "keywords": [ + "code", + "zf2" + ], + "time": "2017-10-20T15:21:32+00:00" }, { "name": "zendframework/zend-db", @@ -787,6 +958,60 @@ ], "time": "2017-12-11T14:57:52+00:00" }, + { + "name": "zendframework/zend-eventmanager", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/zendframework/zend-eventmanager.git", + "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "reference": "9d72db10ceb6e42fb92350c0cb54460da61bd79c", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "athletic/athletic": "^0.1", + "container-interop/container-interop": "^1.1.0", + "phpunit/phpunit": "^6.0.7 || ^5.7.14", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0" + }, + "suggest": { + "container-interop/container-interop": "^1.1.0, to use the lazy listeners feature", + "zendframework/zend-stdlib": "^2.7.3 || ^3.0, to use the FilterChain feature" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev", + "dev-develop": "3.3-dev" + } + }, + "autoload": { + "psr-4": { + "Zend\\EventManager\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Trigger and listen to events within a PHP application", + "homepage": "https://github.com/zendframework/zend-eventmanager", + "keywords": [ + "event", + "eventmanager", + "events", + "zf2" + ], + "time": "2017-07-11T19:17:22+00:00" + }, { "name": "zendframework/zend-stdlib", "version": "3.1.0", @@ -1091,16 +1316,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.2.0", + "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "66465776cfc249844bde6d117abff1d22e06c2da" + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", - "reference": "66465776cfc249844bde6d117abff1d22e06c2da", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { @@ -1138,7 +1363,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-27T17:38:31+00:00" + "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1189,16 +1414,16 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.3", + "version": "1.7.5", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", - "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", "shasum": "" }, "require": { @@ -1210,7 +1435,7 @@ }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { @@ -1248,7 +1473,7 @@ "spy", "stub" ], - "time": "2017-11-24T13:59:53+00:00" + "time": "2018-02-19T10:16:54+00:00" }, { "name": "phpunit/dbunit", @@ -1553,16 +1778,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.5", + "version": "6.5.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "83d27937a310f2984fd575686138597147bdc7df" + "reference": "6bd77b57707c236833d2b57b968e403df060c9d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/83d27937a310f2984fd575686138597147bdc7df", - "reference": "83d27937a310f2984fd575686138597147bdc7df", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6bd77b57707c236833d2b57b968e403df060c9d9", + "reference": "6bd77b57707c236833d2b57b968e403df060c9d9", "shasum": "" }, "require": { @@ -1633,7 +1858,7 @@ "testing", "xunit" ], - "time": "2017-12-17T06:31:19+00:00" + "time": "2018-02-26T07:01:09+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -1741,21 +1966,21 @@ }, { "name": "sebastian/comparator", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "11c07feade1d65453e06df3b3b90171d6d982087" + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/11c07feade1d65453e06df3b3b90171d6d982087", - "reference": "11c07feade1d65453e06df3b3b90171d6d982087", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", "shasum": "" }, "require": { "php": "^7.0", - "sebastian/diff": "^2.0", + "sebastian/diff": "^2.0 || ^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { @@ -1801,7 +2026,7 @@ "compare", "equality" ], - "time": "2018-01-12T06:34:42+00:00" + "time": "2018-02-01T13:46:46+00:00" }, { "name": "sebastian/diff", @@ -2255,7 +2480,7 @@ }, { "name": "symfony/finder", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", @@ -2344,16 +2569,16 @@ }, { "name": "webmozart/assert", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f" + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f", - "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { @@ -2390,7 +2615,7 @@ "check", "validate" ], - "time": "2016-11-23T20:04:58+00:00" + "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], diff --git a/src/CacheItemPool/AwareTrait.php b/src/CacheItemPool/AwareTrait.php index 4f43166f..77dd4d5c 100644 --- a/src/CacheItemPool/AwareTrait.php +++ b/src/CacheItemPool/AwareTrait.php @@ -7,7 +7,7 @@ trait AwareTrait { - public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool) + public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool): self { $this->_create(CacheItemPoolInterface::class, $cacheItemPool); @@ -23,4 +23,16 @@ protected function _getCacheItemPoolClone(): CacheItemPoolInterface { return clone $this->_getCacheItemPool(); } + + protected function _hasCacheItemPool(): bool + { + return $this->_exists(CacheItemPoolInterface::class); + } + + protected function _unsetCacheItemPool(): self + { + $this->_delete(CacheItemPoolInterface::class); + + return $this; + } } \ No newline at end of file diff --git a/src/CacheItemPool/Factory.php b/src/CacheItemPool/Factory.php new file mode 100644 index 00000000..fcb185a6 --- /dev/null +++ b/src/CacheItemPool/Factory.php @@ -0,0 +1,15 @@ +_create(FactoryInterface::class, $cacheItemPoolFactory); + + return $this; + } + + protected function _getCacheItemPoolFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _getCacheItemPoolFactoryClone(): FactoryInterface + { + return clone $this->_getCacheItemPoolFactory(); + } + + protected function _hasCacheItemPoolFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _unsetCacheItemPoolFactory(): self + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/CacheItemPool/FactoryInterface.php b/src/CacheItemPool/FactoryInterface.php new file mode 100644 index 00000000..2db4a147 --- /dev/null +++ b/src/CacheItemPool/FactoryInterface.php @@ -0,0 +1,12 @@ +_cacheItemPoolCollection[$id])) { + $this->_cacheItemPoolCollection[$id] = $this->_getCacheItemPoolFactory(); + } + + return $this->_cacheItemPoolCollection[$id]; + } +} \ No newline at end of file diff --git a/src/CacheItemPool/Repository/AwareTrait.php b/src/CacheItemPool/Repository/AwareTrait.php new file mode 100644 index 00000000..e6a418fa --- /dev/null +++ b/src/CacheItemPool/Repository/AwareTrait.php @@ -0,0 +1,38 @@ +_create(RepositoryInterface::class, $cacheItemPoolRepository); + + return $this; + } + + protected function _getCacheItemPoolRepository(): RepositoryInterface + { + return $this->_read(RepositoryInterface::class); + } + + protected function _getCacheItemPoolRepositoryClone(): RepositoryInterface + { + return clone $this->_getCacheItemPoolRepository(); + } + + protected function _hasCacheItemPoolRepository(): bool + { + return $this->_exists(RepositoryInterface::class); + } + + protected function _unsetCacheItemPoolRepository(): self + { + $this->_delete(RepositoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/CacheItemPool/RepositoryInterface.php b/src/CacheItemPool/RepositoryInterface.php new file mode 100644 index 00000000..7d21b939 --- /dev/null +++ b/src/CacheItemPool/RepositoryInterface.php @@ -0,0 +1,11 @@ +_getAutoScheduleSqs(); } - protected function _hasAutoScheduleSqsClone(): bool + protected function _hasAutoScheduleSqs(): bool { return $this->_exists(SqsInterface::class); } diff --git a/src/Message/Broker/BrokerAbstract.php b/src/Message/Broker/BrokerAbstract.php index 63ba6afc..0e5bd78d 100644 --- a/src/Message/Broker/BrokerAbstract.php +++ b/src/Message/Broker/BrokerAbstract.php @@ -26,42 +26,42 @@ public function setHost(string $host): BrokerInterface return $this; } - public function setSubscriptionChannelName(string $channelName): BrokerInterface + protected function _getHost(): string { - if ($this->_subscriptionChannelName === null) { - $this->_subscriptionChannelName = $channelName; - }else { - throw new \LogicException('Subscription channel name is already set.'); + if ($this->_host === null) { + throw new \LogicException('Host is not set.'); } - return $this; + return $this->_host; } - public function setPublishChannelName(string $channelName): BrokerInterface + public function setSubscriptionChannelName(string $channelName): BrokerInterface { - if ($this->_publishChannelName === null) { - $this->_publishChannelName = $channelName; + if ($this->_subscriptionChannelName === null) { + $this->_subscriptionChannelName = $channelName; + }else { + throw new \LogicException('Subscription channel name is already set.'); } return $this; } - protected function _getHost(): string + protected function _getSubscriptionChannelName(): string { - if ($this->_host === null) { - throw new \LogicException('Host is not set.'); + if ($this->_subscriptionChannelName === null) { + throw new \LogicException('Subscription channel name is not set.'); } - return $this->_host; + return $this->_subscriptionChannelName; } - protected function _getSubscriptionChannelName(): string + public function setPublishChannelName(string $channelName): BrokerInterface { - if ($this->_subscriptionChannelName === null) { - throw new \LogicException('Subscription channel name is not set.'); + if ($this->_publishChannelName === null) { + $this->_publishChannelName = $channelName; } - return $this->_subscriptionChannelName; + return $this; } protected function _getPublishChannelName(): string diff --git a/src/Message/Broker/BrokerInterface.php b/src/Message/Broker/BrokerInterface.php index bbc90b60..02ac79f3 100644 --- a/src/Message/Broker/BrokerInterface.php +++ b/src/Message/Broker/BrokerInterface.php @@ -16,4 +16,12 @@ public function getNextMessage(): string; public function getPublishChannelLength(): int; public function getSubscriptionChannelLength(): int; + + public function setHost(string $host): BrokerInterface; + + public function setSubscriptionChannelName(string $channelName): BrokerInterface; + + public function setPublishChannelName(string $channelName): BrokerInterface; + + public function setPort(int $port): BrokerInterface; } \ No newline at end of file diff --git a/src/Message/Broker/Redis.php b/src/Message/Broker/Redis.php index 73fa36a6..7a71987a 100644 --- a/src/Message/Broker/Redis.php +++ b/src/Message/Broker/Redis.php @@ -101,11 +101,4 @@ public function publishMessage($message): BrokerInterface return $this; } - - public function __destruct() - { - $this->_getRedisClient()->close(); - - return $this; - } } \ No newline at end of file diff --git a/src/Message/Broker/Type/Collection.php b/src/Message/Broker/Type/Collection.php index 061acb7d..b09db523 100644 --- a/src/Message/Broker/Type/Collection.php +++ b/src/Message/Broker/Type/Collection.php @@ -23,7 +23,7 @@ public function addBrokerType(string $typeCode, BrokerInterface $process) public function getBrokerTypeClone(string $typeCode): BrokerInterface { if (!isset($this->_types[$typeCode])) { - throw new \LogicException('Process type is not set.'); + throw new \LogicException('Broker type is not set.'); } return clone $this->_types[$typeCode]; diff --git a/src/Process/Collection.php b/src/Process/Collection.php index 4ac0b514..7f16467b 100644 --- a/src/Process/Collection.php +++ b/src/Process/Collection.php @@ -54,6 +54,8 @@ public function applyProcessPool(PoolInterface $pool): CollectionInterface $processPrototype->setProcessPool($pool); $processPrototype->setParentProcessPath($pool->getProcess()->getPath()); $processPrototype->setParentProcessUuid($pool->getProcess()->getUuid()); + $parentProcessTerminationSignalNumber = $pool->getProcess()->getTerminationSignalNumber(); + $processPrototype->setParentProcessTerminationSignalNumber($parentProcessTerminationSignalNumber); } return $this; diff --git a/src/Process/Forkable.php b/src/Process/Forkable.php deleted file mode 100644 index 6856e5e5..00000000 --- a/src/Process/Forkable.php +++ /dev/null @@ -1,42 +0,0 @@ -_create(self::PROP_HAS_FORKED, true); - $processId = $this->_getProcessStrategy()->fork(); - if ($processId === self::FORK_FAILURE_CODE) { - throw new \RuntimeException('Failed to fork new process.'); - }elseif ($processId > 0) { - // This is executed in the Process Pool. - $this->_initialize($processId); - $this->_getLogger()->debug("Forked Process[{$this->getProcessId()}][{$this->getTypeCode()}]."); - }else { - // This is executed in the Process. - $this->_initialize(); - if ($this->_hasProcessPool()) { - $this->_getProcessPool()->emptyChildProcesses(); - $this->_unsetProcessPool(); - } - - $this->_getLogger()->debug("Running Process..."); - $this->_run(); - $this->_getLogger()->debug("Process finished running."); - $this->_exit(0); - } - - return $this; - } - - abstract protected function _run(): Forkable; -} \ No newline at end of file diff --git a/src/Process/Forked.php b/src/Process/Forked.php new file mode 100644 index 00000000..371a0f17 --- /dev/null +++ b/src/Process/Forked.php @@ -0,0 +1,64 @@ +_create(self::PROP_HAS_FORKED, true); + $processId = $this->_getProcessStrategy()->fork(); + if ($processId === self::FORK_FAILURE_CODE) { + throw new \RuntimeException('Failed to fork new process.'); + }elseif ($processId > 0) { + // This is executed in the parent process. + $this->_initialize($processId); + $this->_getLogger()->debug("Forked Process[{$this->getProcessId()}][{$this->getTypeCode()}]."); + }else { + // This is executed in the child process. + $this->_initialize($processId); + $this->_removeParentProcessPool(); + $this->_startProcessPool(); + } + + return $this; + } + + protected function _removeParentProcessPool(): Forked + { + $this->_getProcessPool()->emptyChildProcesses(); + $this->_unsetProcessPool(); + + return $this; + } + + protected function _startProcessPool(): Forked + { + $this->setProcessPool($this->_getProcessPoolFactory()->create()); + $this->_getProcessPool()->setProcess($this); + $this->_getProcessPool()->start(); + + return $this; + } + + public function processPoolStarted(): ProcessInterface + { + $this->_getLogger()->debug("Running Process..."); + $this->_run(); + $this->_getLogger()->debug("Process finished running."); + $this->_exit(0); + + return $this; + } + + abstract protected function _run(): Forked; +} \ No newline at end of file diff --git a/src/Process/Job.php b/src/Process/Job.php index c987d797..dcfc59b3 100644 --- a/src/Process/Job.php +++ b/src/Process/Job.php @@ -8,16 +8,18 @@ use NHDS\Jobs\Scheduler; use NHDS\Jobs\Maintainer; use NHDS\Jobs\Selector; +use NHDS\Jobs\Process; -class Job extends Forkable implements JobInterface +class Job extends Forked implements JobInterface { use Bootstrap\AwareTrait; use Foreman\AwareTrait; use Maintainer\AwareTrait; use Scheduler\AwareTrait; use Selector\AwareTrait; + use Process\Pool\Factory\AwareTrait; - protected function _run(): Forkable + protected function _run(): Forked { $this->_getSelector()->setProcess($this); $this->_getBootstrap()->instantiate(); diff --git a/src/Process/Listener/Command.php b/src/Process/Listener/Command.php index e573bdba..e845ad67 100644 --- a/src/Process/Listener/Command.php +++ b/src/Process/Listener/Command.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Process\Listener; -use NHDS\Jobs\Process\Forkable; +use NHDS\Jobs\Process\Forked; use NHDS\Jobs\Process\ListenerInterface; use NHDS\Jobs\Process\ListenerAbstract; use Symfony\Component\ExpressionLanguage\ExpressionLanguage; @@ -62,7 +62,7 @@ protected function _getExpressionLanguage(): ExpressionLanguage return $this->_read(self::PROP_EXPRESSION_LANGUAGE); } - protected function _run(): Forkable + protected function _run(): Forked { if (!$this->_getMessageBroker()->hasMessage()) { $this->_getMessageBroker()->waitForNewMessage(); diff --git a/src/Process/Listener/Mutex/Redis.php b/src/Process/Listener/Mutex/Redis.php new file mode 100644 index 00000000..171fdbb4 --- /dev/null +++ b/src/Process/Listener/Mutex/Redis.php @@ -0,0 +1,54 @@ +_register(); + + return $this; + } + + protected function _register(): ProcessInterface + { + $this->_getLogger()->debug("CLIENT SETNAME {$this->getParentProcessUuid()}"); + $this->_getRedis()->client('SETNAME', $this->getParentProcessUuid()); + $this->_getMessageBroker()->setPublishChannelName($this->getParentProcessUuid()); + $this->_getMessageBroker()->setSubscriptionChannelName($this->getParentProcessUuid()); + $this->_getMessageBroker()->waitForNewMessage(); + posix_kill($this->getParentProcessId(), $this->getParentProcessTerminationSignalNumber()); + + return $this; + } + + public function processMessages(): ListenerInterface + { + throw new \RuntimeException('The connection to redis was lost.'); + } + + public function hasMessages(): bool + { + return true; + } + + protected function _getRedis(): \Redis + { + if (!$this->_exists(self::PROP_REDIS)) { + $this->_create(self::PROP_REDIS, $this->_getRedisFactory()->create()); + } + + return $this->_read(self::PROP_REDIS); + } +} \ No newline at end of file diff --git a/src/Process/Listener/Mutex/RedisInterface.php b/src/Process/Listener/Mutex/RedisInterface.php new file mode 100644 index 00000000..4ef9ffe6 --- /dev/null +++ b/src/Process/Listener/Mutex/RedisInterface.php @@ -0,0 +1,10 @@ +_register(); - return $this; - } - - protected function _register() - { - - } -} \ No newline at end of file diff --git a/src/Process/Pool.php b/src/Process/Pool.php index 4d792286..7be6476c 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -20,17 +20,20 @@ class Pool extends PoolAbstract implements PoolInterface public function start(): PoolInterface { + $this->_getLogger()->debug("Starting process pool..."); $this->_create(self::PROP_STARTED, true); $this->_initialize(); $this->_getLogger()->info("Process pool started."); // Register signals to be handled. pcntl_sigprocmask(SIG_BLOCK, $this->_waitSignals); while (true) { + $this->getProcess()->processPoolStarted(); $this->_getLogger()->debug("Waiting for signal..."); $this->_signalInformation = []; pcntl_sigwaitinfo($this->_waitSignals, $this->_signalInformation); - - switch ($this->_signalInformation[self::SIGNAL_NUMBER]) { + $signalNumber = $this->_signalInformation[self::SIGNAL_NUMBER]; + $this->_getLogger()->debug("Received signal($signalNumber)."); + switch ($signalNumber) { case SIGCHLD: $this->_childExitSignal(); break; @@ -99,7 +102,7 @@ public function addChildProcess(ProcessInterface $childProcess): PoolInterface public function getChildProcess(int $childProcessId): ProcessInterface { if (!isset($this->_childProcesses[$childProcessId])) { - throw new \LogicException("Process is with process ID [$childProcessId] not set."); + throw new \LogicException("Process with process ID [$childProcessId] not set."); } return $this->_childProcesses[$childProcessId]; @@ -134,7 +137,8 @@ public function terminateChildProcesses(): PoolInterface $terminationSignalNumber = $process->getTerminationSignalNumber(); $processTypeCode = $process->getTypeCode(); posix_kill($processId, $terminationSignalNumber); - $this->_getLogger()->debug("Sent SIGKILL to Process[$processId][$processTypeCode]."); + $message = "Sent kill($terminationSignalNumber) to Process[$processId][$processTypeCode]."; + $this->_getLogger()->debug($message); unset($this->_childProcesses[$processId]); } } diff --git a/src/Process/Pool/Server.php b/src/Process/Pool/Server.php index 93865985..a9c64e0d 100644 --- a/src/Process/Pool/Server.php +++ b/src/Process/Pool/Server.php @@ -20,7 +20,7 @@ class Server extends ProcessAbstract implements ServerInterface public function start(): ProcessInterface { - $this->_initialize(); + $this->_initialize(0); $this->_getLogger()->info('Starting process pool server...'); if ($this->_getSemaphore()->testAndSetLock($this->_getServerSemaphoreResource())) { $this->_getLogger()->info('Process pool server started.'); @@ -43,4 +43,9 @@ protected function _getServerSemaphoreResource(): Semaphore\ResourceInterface { return $this->_getSemaphoreResource(self::SERVER_SEMAPHORE_RESOURCE_NAME); } + + public function processPoolStarted(): ProcessInterface + { + return $this; + } } \ No newline at end of file diff --git a/src/Process/Pool/Strategy.php b/src/Process/Pool/Strategy.php index e8e800cc..569ff8b7 100644 --- a/src/Process/Pool/Strategy.php +++ b/src/Process/Pool/Strategy.php @@ -110,7 +110,7 @@ public function initializePool(): StrategyInterface { $this->_getProcessPool()->setAlarm($this->getMaxAlarmTime()); $this->_getProcessCollection()->applyProcessPool($this->_getProcessPool()); - foreach ($this->_getProcessCollection()->getIterator() as $process) { + foreach ($this->_getProcessCollection() as $process) { $this->_getProcessPool()->addChildProcess($process); } if ($this->_hasFillProcessTypeCode()) { diff --git a/src/Process/Registry.php b/src/Process/Registry.php new file mode 100644 index 00000000..70e553ac --- /dev/null +++ b/src/Process/Registry.php @@ -0,0 +1,28 @@ +getProcessId(); + if (isset($this->_processes[$processId])) { + throw new \LogicException("Process with ID[$processId] is already set."); + } + + $this->_processes[$processId] = $process; + + return $this; + } + + public function getLastRegisteredProcess(): ProcessInterface + { + return end($this->_processes); + } +} \ No newline at end of file diff --git a/src/Process/Registry/AwareTrait.php b/src/Process/Registry/AwareTrait.php new file mode 100644 index 00000000..0e2676ad --- /dev/null +++ b/src/Process/Registry/AwareTrait.php @@ -0,0 +1,33 @@ +_create(RegistryInterface::class, $registry); + + return $this; + } + + protected function _getProcessRegistry(): RegistryInterface + { + return $this->_read(RegistryInterface::class); + } + + protected function _getProcessRegistryClone(): RegistryInterface + { + return clone $this->_getProcessRegistry(); + } + + protected function _unsetProcessRegistry() + { + $this->_delete(RegistryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Process/RegistryInterface.php b/src/Process/RegistryInterface.php new file mode 100644 index 00000000..4e5b3d00 --- /dev/null +++ b/src/Process/RegistryInterface.php @@ -0,0 +1,13 @@ +setTypeCode(self::TYPE_CODE); } - protected function _run(): Forkable + protected function _run(): Forked { - $this->setProcessPool($this->_getProcessPoolFactory()->create()); - $this->_getProcessPool()->setProcess($this); - $this->_getProcessPool()->start(); + return $this; + } + public function processPoolStarted(): ProcessInterface + { return $this; } } \ No newline at end of file diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index 17c639c2..775582f8 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -9,19 +9,23 @@ abstract class ProcessAbstract implements ProcessInterface { + use Process\Registry\AwareTrait; use Process\Pool\AwareTrait; use Process\Strategy\AwareTrait; use Strict\AwareTrait; use Logger\AwareTrait; + const PROP_IS_PROCESS_TITLE_SET = 'is_process_title_set'; - protected function _initialize(int $processId = null): ProcessAbstract + protected function _initialize(int $processId): ProcessAbstract { - if ($processId === null) { + if ($processId === 0) { + pcntl_async_signals(true); $this->_setParentProcessId(posix_getppid()); $this->_setProcessId(posix_getpid()); $this->_getLogger()->setProcess($this); $this->_registerSignalHandlers(); - cli_set_process_title($this->getPath()); + $this->_setProcessTitle(); + $this->_getProcessRegistry()->pushProcess($this); }else { $this->_setProcessId($processId); } @@ -29,6 +33,16 @@ protected function _initialize(int $processId = null): ProcessAbstract return $this; } + abstract public function processPoolStarted(): ProcessInterface; + + protected function _setProcessTitle(): ProcessInterface + { + $this->_create(self::PROP_IS_PROCESS_TITLE_SET, true); + cli_set_process_title($this->getPath()); + + return $this; + } + protected function _registerSignalHandlers(): ProcessInterface { pcntl_signal(SIGTERM, [$this, 'receivedSignal']); @@ -120,6 +134,7 @@ public function getExitCode(): int public function receivedSignal() { + $this->_getLogger()->debug("Received signal."); $this->_exit(0); } @@ -135,6 +150,18 @@ public function getTerminationSignalNumber(): int return $this->_read(self::PROP_TERMINATION_SIGNAL_NUMBER); } + public function getParentProcessTerminationSignalNumber(): int + { + return $this->_read(self::PROP_PARENT_PROCESS_TERMINATION_SIGNAL_NUMBER); + } + + public function setParentProcessTerminationSignalNumber(int $parentProcessTerminationSignalNumber) + { + $this->_create(self::PROP_PARENT_PROCESS_TERMINATION_SIGNAL_NUMBER, $parentProcessTerminationSignalNumber); + + return $this; + } + public function setParentProcessUuid(string $parentProcessUuid): ProcessInterface { $this->_create(self::PROP_PARENT_PROCESS_UUID, $parentProcessUuid); diff --git a/src/ProcessInterface.php b/src/ProcessInterface.php index 12153daa..08625b97 100644 --- a/src/ProcessInterface.php +++ b/src/ProcessInterface.php @@ -8,17 +8,18 @@ interface ProcessInterface { - const PROP_THROTTLE = 'throttle'; - const PROP_EXIT_CODE = 'exit_code'; - const PROP_PATH = 'path'; - const PROP_TERMINATION_SIGNAL_NUMBER = 'termination_signal_number'; - const PROP_PROCESS_ID = 'process_id'; - const PROP_PARENT_PROCESS_ID = 'parent_process_id'; - const PROP_TYPE_CODE = 'type_code'; - const PROP_PARENT_PROCESS_PATH = 'parent_process_path'; - const PROP_UUID = 'uuid'; - const PROP_UUID_MAXIMUM_INTEGER = 'uuid_maximum_integer'; - const PROP_PARENT_PROCESS_UUID = 'parent_process_uuid'; + const PROP_THROTTLE = 'throttle'; + const PROP_EXIT_CODE = 'exit_code'; + const PROP_PATH = 'path'; + const PROP_TERMINATION_SIGNAL_NUMBER = 'termination_signal_number'; + const PROP_PROCESS_ID = 'process_id'; + const PROP_TYPE_CODE = 'type_code'; + const PROP_UUID = 'uuid'; + const PROP_UUID_MAXIMUM_INTEGER = 'uuid_maximum_integer'; + const PROP_PARENT_PROCESS_ID = 'parent_process_id'; + const PROP_PARENT_PROCESS_PATH = 'parent_process_path'; + const PROP_PARENT_PROCESS_UUID = 'parent_process_uuid'; + const PROP_PARENT_PROCESS_TERMINATION_SIGNAL_NUMBER = 'parent_process_termination_signal_number'; public function start(): ProcessInterface; @@ -57,4 +58,10 @@ public function setUuidMaximumInteger(int $uuidMaximumInteger): ProcessInterface public function setParentProcessUuid(string $parentProcessUuid): ProcessInterface; public function getParentProcessUuid(): string; + + public function getParentProcessTerminationSignalNumber(); + + public function setParentProcessTerminationSignalNumber(int $parentProcessTerminationSignalNumber); + + public function processPoolStarted(): ProcessInterface; } \ No newline at end of file diff --git a/src/Redis/AwareTrait.php b/src/Redis/AwareTrait.php new file mode 100644 index 00000000..c8a7b9b1 --- /dev/null +++ b/src/Redis/AwareTrait.php @@ -0,0 +1,36 @@ +_create(\Redis::class, $redis); + + return $this; + } + + protected function _hasRedis(): bool + { + return $this->_exists(\Redis::class); + } + + protected function _getRedis(): \Redis + { + return $this->_read(\Redis::class); + } + + protected function _getRedisClone(): \Redis + { + return clone $this->_getRedis(); + } + + protected function _unsetRedis(): self + { + $this->_delete(\Redis::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Redis/Factory.php b/src/Redis/Factory.php new file mode 100644 index 00000000..e654a395 --- /dev/null +++ b/src/Redis/Factory.php @@ -0,0 +1,74 @@ +connect($this->_getHost(), $this->_getPort()); + if ($this->_hasOptions()) { + foreach ($this->_getOptions() as $optionName => $optionValue) { + $redis->setOption($optionName, $optionValue); + } + } + + return $redis; + } + + public function setPort(int $port): FactoryInterface + { + $this->_create(self::PROP_PORT, $port); + + return $this; + } + + protected function _getPort(): int + { + return $this->_read(self::PROP_PORT); + } + + public function setHost(string $host): FactoryInterface + { + $this->_create(self::PROP_HOST, $host); + + return $this; + } + + protected function _getHost(): string + { + return $this->_read(self::PROP_HOST); + } + + public function addOption(int $optionName, string $optionValue): FactoryInterface + { + if (isset($this->_options[$optionName])) { + $optionValue = $this->_options[$optionName]; + throw new \LogicException("Option [$optionName] is already set with value [$optionValue]."); + } + + $this->_options[$optionName] = $optionValue; + + return $this; + } + + protected function _hasOptions(): bool + { + return !empty($this->_options); + } + + protected function _getOptions(): array + { + return $this->_options; + } +} \ No newline at end of file diff --git a/src/Redis/Factory/AwareTrait.php b/src/Redis/Factory/AwareTrait.php new file mode 100644 index 00000000..8eebfe7c --- /dev/null +++ b/src/Redis/Factory/AwareTrait.php @@ -0,0 +1,38 @@ +_create(FactoryInterface::class, $factory); + + return $this; + } + + protected function _hasRedisFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _getRedisFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _getRedisFactoryClone(): FactoryInterface + { + return clone $this->_getRedisFactory(); + } + + protected function _unsetRedisFactory() + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Redis/FactoryInterface.php b/src/Redis/FactoryInterface.php new file mode 100644 index 00000000..a3397152 --- /dev/null +++ b/src/Redis/FactoryInterface.php @@ -0,0 +1,22 @@ +_redisCollection[$id])) { + $this->_redisCollection[$id] = $this->_getRedisFactory()->create(); + } + + return $this->_redisCollection[$id]; + } +} \ No newline at end of file diff --git a/src/Semaphore/Mutex/Redis.php b/src/Semaphore/Mutex/Redis.php index 89025d3d..3612a29c 100644 --- a/src/Semaphore/Mutex/Redis.php +++ b/src/Semaphore/Mutex/Redis.php @@ -5,21 +5,127 @@ use NHDS\Jobs\Semaphore\MutexAbstract; use NHDS\Jobs\Semaphore\MutexInterface; +use NHDS\Toolkit\Data\Property\Strict; +use NHDS\Jobs\Process\Pool\Logger; +use NHDS\Jobs\Process; class Redis extends MutexAbstract implements RedisInterface { + use Strict\AwareTrait; + use Logger\AwareTrait; + use Process\Registry\AwareTrait; + const PROP_REDIS = 'redis'; + const PROP_KEY = 'key'; + protected $_hasLock = false; + public function testAndSetLock(): bool { - // Has a redis mutex process been forked? + if ($this->_hasLock === false) { + $this->_getRedis()->watch($this->_getKey()); + + // If the mutex resource ID is set, then check if the owning client is connected. + $mutexKeyValue = $this->_getRedis()->get($this->_getKey()); + if (!empty($mutexKeyValue)) { + $mutexClientIsConnected = false; + + // Get a list of connected clients. + $clients = $this->_getRedis()->client('LIST'); + foreach ($clients as $client) { + if ($client['name'] === $mutexKeyValue) { + $mutexClientIsConnected = true; + break; + } + } + + // If the client that registered for the mutex resource ID is connected, the mutex is held by another client. + if ($mutexClientIsConnected === false) { + // If not, try to obtain the lock by registering on the mutex resource ID. + $this->_getRedis()->multi(); + $this->_getRedis()->set($this->_getKey(), $this->_getParentProcessUuid()); + $reply = $this->_getRedis()->exec(); + + // If the mutex resource ID was not set by another client, the mutex is obtained by this client. + if ($reply[0] === true) { + $this->_hasLock = true; + $this->_getLogger()->debug("Obtained mutex[{$this->_getKey()}]."); + }else { + $this->_getLogger()->debug("Did not obtain mutex[{$this->_getKey()}]."); + } + }else { + $this->_getLogger()->debug("Did not obtain mutex[{$this->_getKey()}]."); + } + }else { + // If the mutex resource ID is not set, try to obtain the mutex. + $this->_getRedis()->multi(); + $this->_getRedis()->set($this->_getKey(), $this->_getParentProcessUuid()); + $reply = $this->_getRedis()->exec(); + if (is_array($reply) && $reply[0] === true) { + $this->_hasLock = true; + $this->_getLogger()->debug("Obtained mutex[{$this->_getKey()}]."); + }elseif (is_bool($reply) && $reply === false) { + $this->_getLogger()->debug("Did not obtain mutex[{$this->_getKey()}]."); + }else { + $type = gettype($reply); + throw new \UnexpectedValueException("Reply is of type [$type]"); + } + } + }else { + throw new \LogicException('The mutex already has obtained a lock.'); + } + + return $this->_hasLock; } public function releaseLock(): MutexInterface { + if ($this->_hasLock === true) { + $this->_getRedis()->del($this->_getKey()); + $this->_getLogger()->debug("Released mutex[{$this->_getKey()}]."); + $this->_hasLock = false; + }else { + throw new \LogicException('The mutex has not obtained a lock.'); + } + return $this; } public function hasLock(): bool { - // TODO: Implement hasLock() method. + return $this->_hasLock; + } + + protected function _getParentProcessUuid(): string + { + return $this->_getProcessRegistry()->getLastRegisteredProcess()->getUuid(); + } + + protected function _getKey(): string + { + if (!$this->_exists(self::PROP_KEY)) { + $key = '/' . $this->_getResource()->getResourcePath() . '/' . $this->_getResource()->getResourceName(); + $this->_create(self::PROP_KEY, $key); + } + + return $this->_read(self::PROP_KEY); + } + + protected function _getRedis(): \Redis + { + if (!$this->_exists(self::PROP_REDIS)) { + // Connect to Redis. + $redis = new \Redis(); + $redis->connect('redis'); + $redis->setOption(\Redis::OPT_READ_TIMEOUT, '-1'); + $this->_create(self::PROP_REDIS, $redis); + } + + return $this->_read(self::PROP_REDIS); + } + + public function setRedis(\Redis $redis): RedisInterface + { +// $this->_create(self::PROP_REDIS, $redis); + + return $this; } } \ No newline at end of file diff --git a/src/bin/jobs b/src/bin/jobs index fbe30490..708e2bca 100755 --- a/src/bin/jobs +++ b/src/bin/jobs @@ -9,10 +9,10 @@ if (PHP_SAPI !== 'cli') { exit(1); } try{ - foreach (array( + foreach ([ __DIR__ . '/../../../../autoload.php', __DIR__ . '/../../vendor/autoload.php', - ) as $autoLoaderFilePathCandidate) { + ] as $autoLoaderFilePathCandidate) { if (file_exists($autoLoaderFilePathCandidate)) { require_once $autoLoaderFilePathCandidate; break; diff --git a/src/bin/server b/src/bin/server index bb41fd0f..b272b979 100755 --- a/src/bin/server +++ b/src/bin/server @@ -9,10 +9,10 @@ if (PHP_SAPI !== 'cli') { exit(1); } try{ - foreach (array( + foreach ([ __DIR__ . '/../../../../autoload.php', __DIR__ . '/../../vendor/autoload.php', - ) as $autoLoaderFilePathCandidate) { + ] as $autoLoaderFilePathCandidate) { if (file_exists($autoLoaderFilePathCandidate)) { require_once $autoLoaderFilePathCandidate; break; diff --git a/src/config/Message/Broker/Redis.yml b/src/config/Message/Broker/Redis.yml index 04dfd983..0cd731a7 100644 --- a/src/config/Message/Broker/Redis.yml +++ b/src/config/Message/Broker/Redis.yml @@ -9,4 +9,13 @@ services: - [setSubscriptionChannelName, ['job_listener_subscribe']] - [setPublishChannelName, ['job_listener_publish']] message.broker.redis: - alias: nhds.jobs.message.broker.redis \ No newline at end of file + alias: nhds.jobs.message.broker.redis + nhds.jobs.message.broker.redis[process.listener.mutex.redis]: + class: NHDS\Jobs\Message\Broker\Redis + shared: false + calls: + - [setLogger, ['@process.pool.logger']] + - [setPort, ['6379']] + - [setHost, ['redis']] + message.broker.redis[process.listener.mutex.redis]: + alias: nhds.jobs.message.broker.redis[process.listener.mutex.redis] \ No newline at end of file diff --git a/src/config/Message/Broker/Type/Collection.yml b/src/config/Message/Broker/Type/Collection.yml index aeb8237a..897759ec 100644 --- a/src/config/Message/Broker/Type/Collection.yml +++ b/src/config/Message/Broker/Type/Collection.yml @@ -3,5 +3,6 @@ services: class: NHDS\Jobs\Message\Broker\Type\Collection calls: - [addBrokerType, ['job_broker', '@message.broker.redis']] + - [addBrokerType, ['process.listener.mutex.redis', '@message.broker.redis[process.listener.mutex.redis]']] message.broker.type.collection-job: alias: nhds.jobs.message.broker.type.collection-job \ No newline at end of file diff --git a/src/config/Process/Collection.yml b/src/config/Process/Collection.yml index 65d632f8..a6785636 100644 --- a/src/config/Process/Collection.yml +++ b/src/config/Process/Collection.yml @@ -16,4 +16,19 @@ services: - [setIterator, ['@process.collection.iterator']] - [addProcessPrototype, ['@process.root']] process.collection-server: - alias: nhds.jobs.process.collection-server \ No newline at end of file + alias: nhds.jobs.process.collection-server + nhds.jobs.process.collection-job: + shared: true + class: NHDS\Jobs\Process\Collection + calls: + - [setIterator, ['@process.collection.iterator']] + - [addProcessPrototype, ['@process.listener.mutex.redis']] + process.collection-job: + alias: nhds.jobs.process.collection-job + nhds.jobs.process.collection-empty: + shared: true + class: NHDS\Jobs\Process\Collection + calls: + - [setIterator, ['@process.collection.iterator']] + process.collection-empty: + alias: nhds.jobs.process.collection-empty \ No newline at end of file diff --git a/src/config/Process/Job.yml b/src/config/Process/Job.yml index 6a7588fa..87934750 100644 --- a/src/config/Process/Job.yml +++ b/src/config/Process/Job.yml @@ -13,5 +13,7 @@ services: - [setProcessStrategy, ['@process.strategy.process_control']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] + - [setProcessRegistry, ['@process.registry']] + - [setProcessPoolFactory, ['@process.pool.factory-job']] process.job: alias: nhds.jobs.process.job \ No newline at end of file diff --git a/src/config/Process/Job/Required.yml b/src/config/Process/Job/Required.yml index a7995a13..23d16881 100644 --- a/src/config/Process/Job/Required.yml +++ b/src/config/Process/Job/Required.yml @@ -13,5 +13,7 @@ services: - [setSelector, ['@selector']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] + - [setProcessRegistry, ['@process.registry']] + - [setProcessPoolFactory, ['@process.pool.factory-job']] process.job.required: alias: nhds.jobs.process.job.required \ No newline at end of file diff --git a/src/config/Process/Listener/Command.yml b/src/config/Process/Listener/Command.yml index 97467cbb..f2bca2e6 100644 --- a/src/config/Process/Listener/Command.yml +++ b/src/config/Process/Listener/Command.yml @@ -4,12 +4,14 @@ services: calls: - [setTypeCode, ['listener.command']] - [setBrokerTypeCollection, ['@nhds.jobs.message.broker.type.collection-job']] - - [setLogger, ['@process.pool.logger']] - [setBrokerTypeCode, ['job_broker']] + - [setLogger, ['@process.pool.logger']] - [setExpressionLanguage, ['@symfony.component.expressionlanguage.expressionlanguage']] - [setProcessCollection, ['@process.collection']] - [setProcessStrategy, ['@process.strategy.process_control']] + - [setProcessRegistry, ['@process.registry']] - [setTerminationSignalNumber, ['@=constant("SIGKILL")']] - [setUuidMaximumInteger, [9999999999]] + - [setProcessPoolFactory, ['@process.pool.factory-empty']] process.listener.command: alias: nhds.jobs.process.listener.command \ No newline at end of file diff --git a/src/config/Process/Listener/Mutex/Redis.yml b/src/config/Process/Listener/Mutex/Redis.yml new file mode 100644 index 00000000..bb344d67 --- /dev/null +++ b/src/config/Process/Listener/Mutex/Redis.yml @@ -0,0 +1,19 @@ +services: + nhds.jobs.process.listener.mutex.redis: + class: NHDS\Jobs\Process\Listener\Mutex\Redis + public: false + shared: false + calls: + - [setTypeCode, ['listener.mutex.redis']] + - [setLogger, ['@process.pool.logger']] + - [setProcessStrategy, ['@process.strategy.process_control']] + - [setProcessRegistry, ['@process.registry']] + - [setTerminationSignalNumber, ['@=constant("SIGKILL")']] + - [setUuidMaximumInteger, [9999999999]] + - [setBrokerTypeCollection, ['@nhds.jobs.message.broker.type.collection-job']] + - [setBrokerTypeCode, ['process.listener.mutex.redis']] + - [setProcessPoolFactory, ['@process.pool.factory-empty']] + - [setRedisFactory, ['@redis.factory']] + process.listener.mutex.redis: + alias: nhds.jobs.process.listener.mutex.redis + public: false \ No newline at end of file diff --git a/src/config/Process/Pool/Factory.yml b/src/config/Process/Pool/Factory.yml index 65ba833e..8ad91cc0 100644 --- a/src/config/Process/Pool/Factory.yml +++ b/src/config/Process/Pool/Factory.yml @@ -1,10 +1,16 @@ parameters: process_pool_strategy.max_child_processes: 10 process_pool_strategy.child_process_wait_throttle: 1 - process_pool_strategy.max_alarm_time: 30 + process_pool_strategy.max_alarm_time: 0 process_pool_strategy-server.max_child_processes: 1 process_pool_strategy-server.child_process_wait_throttle: 1 - process_pool_strategy-server.max_alarm_time: 3600 + process_pool_strategy-server.max_alarm_time: 0 + process_pool_strategy-job.max_child_processes: 1 + process_pool_strategy-job.child_process_wait_throttle: 0 + process_pool_strategy-job.max_alarm_time: 0 + process_pool_strategy-empty.max_child_processes: 0 + process_pool_strategy-empty.child_process_wait_throttle: 0 + process_pool_strategy-empty.max_alarm_time: 0 services: nhds.jobs.process.pool.factory: class: NHDS\Jobs\Process\Pool\Factory @@ -29,4 +35,28 @@ services: - [setProcessPoolStrategy, ['@process.pool.strategy-server']] - [setProcessCollection, ['@process.collection-server']] process.pool.factory-server: - alias: nhds.jobs.process.pool.factory-server \ No newline at end of file + alias: nhds.jobs.process.pool.factory-server + nhds.jobs.process.pool.factory-job: + class: NHDS\Jobs\Process\Pool\Factory + shared: false + calls: + - [setMaxChildProcesses, ['%process_pool_strategy-job.max_child_processes%']] + - [setChildProcessWaitThrottle, ['%process_pool_strategy-job.child_process_wait_throttle%']] + - [setMaxAlarmTime, ['%process_pool_strategy-job.max_alarm_time%']] + - [setProcessPool, ['@process.pool']] + - [setProcessPoolStrategy, ['@process.pool.strategy-job']] + - [setProcessCollection, ['@process.collection-job']] + process.pool.factory-job: + alias: nhds.jobs.process.pool.factory-job + nhds.jobs.process.pool.factory-empty: + class: NHDS\Jobs\Process\Pool\Factory + shared: false + calls: + - [setMaxChildProcesses, ['%process_pool_strategy-empty.max_child_processes%']] + - [setChildProcessWaitThrottle, ['%process_pool_strategy-empty.child_process_wait_throttle%']] + - [setMaxAlarmTime, ['%process_pool_strategy-empty.max_alarm_time%']] + - [setProcessPool, ['@process.pool']] + - [setProcessPoolStrategy, ['@process.pool.strategy-job']] + - [setProcessCollection, ['@process.collection-empty']] + process.pool.factory-empty: + alias: nhds.jobs.process.pool.factory-empty \ No newline at end of file diff --git a/src/config/Process/Pool/Logger.yml b/src/config/Process/Pool/Logger.yml index ee646cac..3908b873 100644 --- a/src/config/Process/Pool/Logger.yml +++ b/src/config/Process/Pool/Logger.yml @@ -1,7 +1,7 @@ parameters: process.pool.logger.process_id_padding: 6 - process.pool.logger.path_padding: 63 - process.pool.logger.is_enabled: false + process.pool.logger.path_padding: 80 + process.pool.logger.is_enabled: true services: nhds.jobs.process.pool.logger: class: NHDS\Jobs\Process\Pool\Logger diff --git a/src/config/Process/Pool/Server.yml b/src/config/Process/Pool/Server.yml index 36b61476..98893da3 100644 --- a/src/config/Process/Pool/Server.yml +++ b/src/config/Process/Pool/Server.yml @@ -10,6 +10,7 @@ services: - [setTypeCode, ['server']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] + - [setProcessRegistry, ['@process.registry']] process.pool.server: public: true alias: nhds.jobs.process.pool.server \ No newline at end of file diff --git a/src/config/Process/Pool/Strategy.yml b/src/config/Process/Pool/Strategy.yml index 471cfe14..7286b0b6 100644 --- a/src/config/Process/Pool/Strategy.yml +++ b/src/config/Process/Pool/Strategy.yml @@ -1,6 +1,7 @@ parameters: process.pool.strategy.maximum_load_average: 10.0 process.pool.strategy-server.maximum_load_average: 10.0 + process.pool.strategy-job.maximum_load_average: 10.0 services: nhds.jobs.process.pool.strategy: shared: false @@ -18,6 +19,14 @@ services: - [setAlarmProcessTypeCode, ['root']] - [setFillProcessTypeCode, ['root']] - [setLogger, ['@process.pool.logger']] - - [setMaximumLoadAverage, ['%process.pool.strategy.maximum_load_average%']] + - [setMaximumLoadAverage, ['%process.pool.strategy-server.maximum_load_average%']] process.pool.strategy-server: - alias: nhds.jobs.process.pool.strategy-server \ No newline at end of file + alias: nhds.jobs.process.pool.strategy-server + nhds.jobs.process.pool.strategy-job: + shared: false + class: NHDS\Jobs\Process\Pool\Strategy + calls: + - [setLogger, ['@process.pool.logger']] + - [setMaximumLoadAverage, ['%process.pool.strategy-job.maximum_load_average%']] + process.pool.strategy-job: + alias: nhds.jobs.process.pool.strategy-job \ No newline at end of file diff --git a/src/config/Process/Registry.yml b/src/config/Process/Registry.yml new file mode 100644 index 00000000..53944f29 --- /dev/null +++ b/src/config/Process/Registry.yml @@ -0,0 +1,8 @@ +services: + nhds.jobs.process.registry: + class: NHDS\Jobs\Process\Registry + public: false + shared: true + process.registry: + alias: nhds.jobs.process.registry + public: false \ No newline at end of file diff --git a/src/config/Process/Root.yml b/src/config/Process/Root.yml index e4883096..e9ba8fb3 100644 --- a/src/config/Process/Root.yml +++ b/src/config/Process/Root.yml @@ -7,5 +7,6 @@ services: - [setProcessStrategy, ['@process.strategy.process_control']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] + - [setProcessRegistry, ['@process.registry']] process.root: alias: nhds.jobs.process.root \ No newline at end of file diff --git a/src/config/Redis/Factory.yml b/src/config/Redis/Factory.yml new file mode 100644 index 00000000..43fffa92 --- /dev/null +++ b/src/config/Redis/Factory.yml @@ -0,0 +1,15 @@ +parameters: + redis.factory.host: 'redis' + redis.factory.port: 6379 +services: + nhds.jobs.redis.factory: + class: NHDS\Jobs\Redis\Factory + public: false + shared: true + calls: + - [addOption, [!php/const \Redis::OPT_READ_TIMEOUT, '-1']] + - [setHost, ['%redis.factory.host%']] + - [setPort, ['%redis.factory.port%']] + redis.factory: + alias: nhds.jobs.redis.factory + public: false \ No newline at end of file diff --git a/src/config/Semaphore/Mutex/Redis.yml b/src/config/Semaphore/Mutex/Redis.yml new file mode 100644 index 00000000..46491b5a --- /dev/null +++ b/src/config/Semaphore/Mutex/Redis.yml @@ -0,0 +1,12 @@ +services: + nhds.jobs.semaphore.mutex.redis: + class: NHDS\Jobs\Semaphore\Mutex\Redis + shared: false + public: false + calls: + - [setLogger, ['@process.pool.logger']] + - [setRedis, ['@redis']] + - [setProcessRegistry, ['@process.registry']] + semaphore.mutex.redis: + alias: nhds.jobs.semaphore.mutex.redis + public: false \ No newline at end of file diff --git a/src/config/Semaphore/Resource/Factory.yml b/src/config/Semaphore/Resource/Factory.yml index 31cd146b..c5a907ae 100644 --- a/src/config/Semaphore/Resource/Factory.yml +++ b/src/config/Semaphore/Resource/Factory.yml @@ -5,7 +5,7 @@ services: - [setName, ['job']] - [setSemaphoreResource, ['@semaphore.resource-job']] - [setSemaphoreResourceOwner, ['@semaphore.resource.owner.job']] - - [setMutex, ['@semaphore.mutex.flock']] + - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-job: alias: nhds.jobs.semaphore.resource.factory-job @@ -14,7 +14,7 @@ services: calls: - [setName, ['maintainer_delete']] - [setSemaphoreResource, ['@semaphore.resource-maintainer_delete']] - - [setMutex, ['@semaphore.mutex.flock']] + - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-maintainer_delete: alias: nhds.jobs.semaphore.resource.factory-maintainer_delete @@ -23,7 +23,7 @@ services: calls: - [setName, ['update_pending_jobs']] - [setSemaphoreResource, ['@semaphore.resource-update_pending_jobs']] - - [setMutex, ['@semaphore.mutex.flock']] + - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-update_pending_jobs: alias: nhds.jobs.semaphore.resource.factory-update_pending_jobs @@ -32,7 +32,7 @@ services: calls: - [setName, ['reschedule_jobs']] - [setSemaphoreResource, ['@semaphore.resource-reschedule_jobs']] - - [setMutex, ['@semaphore.mutex.flock']] + - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-reschedule_jobs: alias: nhds.jobs.semaphore.resource.factory-reschedule_jobs @@ -41,7 +41,7 @@ services: calls: - [setName, ['schedule']] - [setSemaphoreResource, ['@semaphore.resource-schedule']] - - [setMutex, ['@semaphore.mutex.flock']] + - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-schedule: alias: nhds.jobs.semaphore.resource.factory-schedule diff --git a/src/config/dependencies.yml b/src/config/dependencies.yml index 6e90621b..7b437ab0 100644 --- a/src/config/dependencies.yml +++ b/src/config/dependencies.yml @@ -8,6 +8,8 @@ services: class: \Symfony\Component\ExpressionLanguage\ExpressionLanguage redis: class: \Redis + shared: false; + lazy: true calls: - [connect, ['redis', '6379']] nhds.jobs.symfony.component.console.application: diff --git a/src/config/root.yml b/src/config/root.yml index 2027b190..e3ef5640 100644 --- a/src/config/root.yml +++ b/src/config/root.yml @@ -48,6 +48,7 @@ imports: - { resource: Service/Update/Complete/Success/Factory.yml } - { resource: Semaphore/Resource/Factory.yml } - { resource: Process/Pool/Factory.yml } + - { resource: Redis/Factory.yml } # Services. - { resource: State/Service.yml } @@ -66,14 +67,16 @@ imports: - { resource: Semaphore/Resource.yml } - { resource: Semaphore/Resource/Owner/Job.yml } - { resource: Semaphore/Mutex/Flock.yml } + - { resource: Semaphore/Mutex/Redis.yml } - { resource: Semaphore.yml } # Process. - - { resource: Process/Listener/Command.yml } + - { resource: Process/Root.yml } + - { resource: Process/Registry.yml } - { resource: Process/Job.yml } - { resource: Process/Job/Required.yml } - - { resource: Process/Root.yml } - - { resource: Process/Pool/Logger.yml } + - { resource: Process/Listener/Command.yml } + - { resource: Process/Listener/Mutex/Redis.yml } - { resource: Process/Pool/Server.yml } - { resource: Process/Pool/Strategy.yml } - { resource: Process/Pool.yml } @@ -112,4 +115,7 @@ imports: # Console. - { resource: Console/Command/Process/Pool/Server/Start.yml } - { resource: Console/Command/Db/Setup/Install.yml } - - { resource: Console/Command/Db/TearDown/Uninstall.yml } \ No newline at end of file + - { resource: Console/Command/Db/TearDown/Uninstall.yml } + + # Logging. + - { resource: Process/Pool/Logger.yml } \ No newline at end of file diff --git a/tests/Unit/ForemanInterfaceTest.php b/tests/Unit/ForemanInterfaceTest.php index 692ec905..0e9083b9 100644 --- a/tests/Unit/ForemanInterfaceTest.php +++ b/tests/Unit/ForemanInterfaceTest.php @@ -6,7 +6,7 @@ use NHDS\Jobs\ForemanInterface; use NHDS\Jobs\Process\JobInterface; use NHDS\Jobs\SelectorInterface; -use NHDS\Watch\Fixture\AbstractTest; +use Neighborhoods\Scaffolding\Fixture\AbstractTest; class ForemanInterfaceTest extends AbstractTest { diff --git a/tests/Unit/MaintainerInterfaceTest.php b/tests/Unit/MaintainerInterfaceTest.php index e6f2201d..2fb83be5 100644 --- a/tests/Unit/MaintainerInterfaceTest.php +++ b/tests/Unit/MaintainerInterfaceTest.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Test\Unit; -use NHDS\Watch\Fixture; +use Neighborhoods\Scaffolding\Fixture; class MaintainerInterfaceTest extends Fixture\AbstractTest { diff --git a/tests/Unit/Process/PooIInterfaceTest.php b/tests/Unit/Process/PooIInterfaceTest.php index 0c4623e3..0d69eb49 100644 --- a/tests/Unit/Process/PooIInterfaceTest.php +++ b/tests/Unit/Process/PooIInterfaceTest.php @@ -4,7 +4,7 @@ namespace NHDS\Jobs\Test\Unit\Process\Pool; use NHDS\Jobs\Process\PoolInterface; -use NHDS\Watch\Fixture\AbstractTest; +use Neighborhoods\Scaffolding\Fixture\AbstractTest; /** @covers PoolInterface */ class PoolTest extends AbstractTest diff --git a/tests/Unit/Process/Pool/ServerInterfaceTest.php b/tests/Unit/Process/Pool/ServerInterfaceTest.php index 58021bbf..f7334b44 100644 --- a/tests/Unit/Process/Pool/ServerInterfaceTest.php +++ b/tests/Unit/Process/Pool/ServerInterfaceTest.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Test\Unit\Process\Pool; -use NHDS\Watch\Fixture\AbstractTest; +use Neighborhoods\Scaffolding\Fixture\AbstractTest; class ServerInterfaceTest extends AbstractTest { diff --git a/tests/Unit/SchedulerInterfaceTest.php b/tests/Unit/SchedulerInterfaceTest.php index 0a34cb23..6fb1fc04 100644 --- a/tests/Unit/SchedulerInterfaceTest.php +++ b/tests/Unit/SchedulerInterfaceTest.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Test\Unit; -use NHDS\Watch\Fixture; +use Neighborhoods\Scaffolding\Fixture; class SchedulerInterfaceTest extends Fixture\AbstractTest { diff --git a/tests/Unit/SelectorInterfaceTest.php b/tests/Unit/SelectorInterfaceTest.php index b715627e..3be682e3 100644 --- a/tests/Unit/SelectorInterfaceTest.php +++ b/tests/Unit/SelectorInterfaceTest.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Test\Unit\Data\Job; -use NHDS\Watch\Fixture; +use Neighborhoods\Scaffolding\Fixture; class SelectorInterfaceTest extends Fixture\AbstractTest { diff --git a/tests/Unit/SemaphoreInterfaceTest.php b/tests/Unit/SemaphoreInterfaceTest.php index dcfb05de..316b0fad 100644 --- a/tests/Unit/SemaphoreInterfaceTest.php +++ b/tests/Unit/SemaphoreInterfaceTest.php @@ -4,7 +4,7 @@ namespace NHDS\Jobs\Test\Unit; use NHDS\Jobs\Semaphore\Resource\Owner; -use NHDS\Watch\AbstractTest; +use Neighborhoods\Scaffolding\AbstractTest; class SemaphoreInterfaceTest extends AbstractTest { diff --git a/tests/Unit/Service/CreateInterfaceTest.php b/tests/Unit/Service/CreateInterfaceTest.php index b4f541f6..f6559f0e 100644 --- a/tests/Unit/Service/CreateInterfaceTest.php +++ b/tests/Unit/Service/CreateInterfaceTest.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Test\Unit\Data\Job; -use NHDS\Watch\Fixture; +use Neighborhoods\Scaffolding\Fixture; class CreateInterfaceTest extends Fixture\AbstractTest { From a074d9c5f459019363f1aff7b42ffacfbb716dbd Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Tue, 13 Mar 2018 09:26:43 -0500 Subject: [PATCH 03/44] - expose user space APIs --- .../Service/Create/Factory/AwareTrait.php | 11 ++++-- .../Service/Create/FactoryInterface.php | 4 +- src/{ => Api}/Service/CreateInterface.php | 2 +- src/Api/Worker/Job/Service/AwareTrait.php | 38 +++++++++++++++++++ src/Api/Worker/Job/ServiceInterface.php | 33 ++++++++++++++++ src/Data/Job/AwareTrait.php | 5 +++ src/Data/Job/Service.php | 3 ++ src/Scheduler.php | 2 +- src/Service/Create.php | 1 + src/Service/Create/AwareTrait.php | 2 +- src/Service/Create/Factory.php | 3 +- src/Worker/Job/Service.php | 4 +- src/Worker/Job/ServiceInterface.php | 6 +-- src/config/dependencies.yml | 4 +- 14 files changed, 102 insertions(+), 16 deletions(-) rename src/{ => Api}/Service/Create/Factory/AwareTrait.php (62%) rename src/{ => Api}/Service/Create/FactoryInterface.php (87%) rename src/{ => Api}/Service/CreateInterface.php (95%) create mode 100644 src/Api/Worker/Job/Service/AwareTrait.php create mode 100644 src/Api/Worker/Job/ServiceInterface.php create mode 100644 src/Data/Job/Service.php diff --git a/src/Service/Create/Factory/AwareTrait.php b/src/Api/Service/Create/Factory/AwareTrait.php similarity index 62% rename from src/Service/Create/Factory/AwareTrait.php rename to src/Api/Service/Create/Factory/AwareTrait.php index b693fd7a..c0951e5a 100644 --- a/src/Service/Create/Factory/AwareTrait.php +++ b/src/Api/Service/Create/Factory/AwareTrait.php @@ -1,9 +1,9 @@ _read(FactoryInterface::class); } - protected function _unsetServiceCreateFactory() + protected function _hasServiceCreateFactory(): bool + { + return $this->_exist(FactoryInterface::class); + } + + protected function _unsetServiceCreateFactory(): self { $this->_delete(FactoryInterface::class); diff --git a/src/Service/Create/FactoryInterface.php b/src/Api/Service/Create/FactoryInterface.php similarity index 87% rename from src/Service/Create/FactoryInterface.php rename to src/Api/Service/Create/FactoryInterface.php index 89a63f38..f0aa21c7 100644 --- a/src/Service/Create/FactoryInterface.php +++ b/src/Api/Service/Create/FactoryInterface.php @@ -1,10 +1,10 @@ _create(ServiceInterface::class, $apiJobService); + + return $this; + } + + protected function _getApiUserJobService(): ServiceInterface + { + return $this->_read(ServiceInterface::class); + } + + protected function _getApiUserJobServiceClone(): ServiceInterface + { + return clone $this->_getApiUserJobService(); + } + + protected function _hasApiUserJobService(): bool + { + return $this->_exists(ServiceInterface::class); + } + + protected function _unsetApiUserJobService(): self + { + $this->_delete(ServiceInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/Worker/Job/ServiceInterface.php b/src/Api/Worker/Job/ServiceInterface.php new file mode 100644 index 00000000..d14b6120 --- /dev/null +++ b/src/Api/Worker/Job/ServiceInterface.php @@ -0,0 +1,33 @@ +_getJob(); } + protected function _hasJob(): bool + { + return $this->_exists(JobInterface::class); + } + protected function _unsetJob() { $this->_delete(JobInterface::class); diff --git a/src/Data/Job/Service.php b/src/Data/Job/Service.php new file mode 100644 index 00000000..91658e53 --- /dev/null +++ b/src/Data/Job/Service.php @@ -0,0 +1,3 @@ + Date: Fri, 23 Mar 2018 14:35:09 -0500 Subject: [PATCH 04/44] mo' pls - refactored to allow and handle IRQs - moved user land Interfaces to Api dir - fixed some bugs, added new bugs --- nhdswatchsrc/AbstractTest.php | 6 +- nhdswatchsrc/Fixture/AbstractTest.php | 8 +- .../Fixture/Expression/NumberPool.php | 2 +- .../Fixture/Expression/Value/AwareTrait.php | 2 +- .../DbUnit/DataSet/SymfonyYamlParser.php | 2 +- .../TestCase/ContainerBuilder/AwareTrait.php | 2 +- nhdswatchsrc/TestCase/Service.php | 4 +- nhdswatchsrc/TestCase/Service/AwareTrait.php | 4 +- nhdswatchsrc/TestCase/ServiceInterface.php | 2 +- nhdswatchsrc/config/TestCase/Service.yml | 2 +- nhdswatchsrc/config/root.yml | 2 +- src/Api/Service/Create/Factory/AwareTrait.php | 7 +- src/Api/Service/Create/FactoryInterface.php | 6 +- .../Service/Create/Factory/AwareTrait.php | 34 ++++++++ .../Type/Service/Create/FactoryInterface.php | 12 +++ src/Api/Worker/Job/Service/AwareTrait.php | 18 ++--- src/Api/Worker/Job/ServiceInterface.php | 1 + src/AutoSchedule/Sqs/Worker.php | 1 + src/AutoSchedule/Sqs/WorkerInterface.php | 1 + src/Data/Job/Type/AwareTrait.php | 6 +- src/Data/Job/TypeInterface.php | 1 - src/Process/Forked.php | 10 +-- src/Process/Pool.php | 59 +++++++------- src/Process/Pool/Server.php | 11 ++- src/Process/PoolAbstract.php | 4 +- src/Process/PoolInterface.php | 2 + src/Process/Root.php | 7 +- src/Process/Signal.php | 50 ++++++++++++ src/Process/Signal/AwareTrait.php | 38 +++++++++ src/Process/SignalInterface.php | 20 +++++ src/ProcessAbstract.php | 77 ++++++++++++------- src/ProcessInterface.php | 4 +- src/Service/Create.php | 2 +- src/Service/Create/AwareTrait.php | 2 +- src/Service/Create/Factory.php | 2 +- src/{Api => }/Service/CreateInterface.php | 4 +- src/Service/Update/Retry.php | 2 + src/Type/Service/Create/AwareTrait.php | 33 ++++++++ src/Type/Service/Create/Factory.php | 21 +++++ src/Type/Service/CreateInterface.php | 21 +++++ src/Worker/Job/Service.php | 4 +- src/Worker/Job/ServiceInterface.php | 2 +- src/config/Process.yml | 2 + src/config/Process/Job.yml | 2 + src/config/Process/Job/Required.yml | 2 + src/config/Process/Listener/Command.yml | 2 + src/config/Process/Listener/Mutex/Redis.yml | 2 + src/config/Process/Pool.yml | 1 + src/config/Process/Pool/Server.yml | 2 + src/config/Process/Root.yml | 2 + src/config/Process/Signal.yml | 8 ++ src/config/root.yml | 2 + 52 files changed, 404 insertions(+), 119 deletions(-) create mode 100644 src/Api/Type/Service/Create/Factory/AwareTrait.php create mode 100644 src/Api/Type/Service/Create/FactoryInterface.php create mode 100644 src/Process/Signal.php create mode 100644 src/Process/Signal/AwareTrait.php create mode 100644 src/Process/SignalInterface.php rename src/{Api => }/Service/CreateInterface.php (86%) create mode 100644 src/Type/Service/Create/AwareTrait.php create mode 100644 src/Type/Service/Create/Factory.php create mode 100644 src/config/Process.yml create mode 100644 src/config/Process/Signal.yml diff --git a/nhdswatchsrc/AbstractTest.php b/nhdswatchsrc/AbstractTest.php index 55465370..a4cac94d 100644 --- a/nhdswatchsrc/AbstractTest.php +++ b/nhdswatchsrc/AbstractTest.php @@ -1,12 +1,12 @@ _create(FactoryInterface::class, $updateCrashFactory); + $this->_create(FactoryInterface::class, $serviceCreateFactory); return $this; } @@ -21,7 +22,7 @@ protected function _getServiceCreateFactory(): FactoryInterface protected function _hasServiceCreateFactory(): bool { - return $this->_exist(FactoryInterface::class); + return $this->_exists(FactoryInterface::class); } protected function _unsetServiceCreateFactory(): self diff --git a/src/Api/Service/Create/FactoryInterface.php b/src/Api/Service/Create/FactoryInterface.php index f0aa21c7..2accbadc 100644 --- a/src/Api/Service/Create/FactoryInterface.php +++ b/src/Api/Service/Create/FactoryInterface.php @@ -4,18 +4,22 @@ namespace NHDS\Jobs\Api\Service\Create; use NHDS\Jobs\Data\Job\Collection\ScheduleLimitInterface; -use NHDS\Jobs\Api\Service\CreateInterface; +use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\State\ServiceInterface; use NHDS\Jobs\Service; interface FactoryInterface extends Service\FactoryInterface { + /** @injected:configuration */ public function setJobCollectionScheduleLimit(ScheduleLimitInterface $jobCollectionScheduleLimit); + /** @injected:configuration */ public function setStateService(ServiceInterface $jobStateService); + /** @injected:configuration */ public function setServiceCreate(CreateInterface $jobServiceUpdateCrash); + /** @injected:configuration */ public function setName(string $factoryName): Service\FactoryInterface; public function create(): CreateInterface; diff --git a/src/Api/Type/Service/Create/Factory/AwareTrait.php b/src/Api/Type/Service/Create/Factory/AwareTrait.php new file mode 100644 index 00000000..73581cc2 --- /dev/null +++ b/src/Api/Type/Service/Create/Factory/AwareTrait.php @@ -0,0 +1,34 @@ +_create(FactoryInterface::class, $updateCrashFactory); + + return $this; + } + + protected function _getTypeServiceCreateFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _hasTypeServiceCreateFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _unsetTypeServiceCreateFactory(): self + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/Type/Service/Create/FactoryInterface.php b/src/Api/Type/Service/Create/FactoryInterface.php new file mode 100644 index 00000000..059de339 --- /dev/null +++ b/src/Api/Type/Service/Create/FactoryInterface.php @@ -0,0 +1,12 @@ +_create(ServiceInterface::class, $apiJobService); + $this->_create(ServiceInterface::class, $workerJobService); return $this; } - protected function _getApiUserJobService(): ServiceInterface + protected function _getWorkerJobService(): ServiceInterface { return $this->_read(ServiceInterface::class); } - protected function _getApiUserJobServiceClone(): ServiceInterface - { - return clone $this->_getApiUserJobService(); - } - - protected function _hasApiUserJobService(): bool + protected function _hasWorkerJobService(): bool { return $this->_exists(ServiceInterface::class); } - protected function _unsetApiUserJobService(): self + protected function _unsetWorkerJobService(): self { $this->_delete(ServiceInterface::class); diff --git a/src/Api/Worker/Job/ServiceInterface.php b/src/Api/Worker/Job/ServiceInterface.php index d14b6120..75cb6bfb 100644 --- a/src/Api/Worker/Job/ServiceInterface.php +++ b/src/Api/Worker/Job/ServiceInterface.php @@ -7,6 +7,7 @@ interface ServiceInterface { + /** @injected:runtime */ public function setJob(JobInterface $job): ServiceInterface; public function requestCompleteSuccess(): ServiceInterface; diff --git a/src/AutoSchedule/Sqs/Worker.php b/src/AutoSchedule/Sqs/Worker.php index 0665fe0b..253396e1 100644 --- a/src/AutoSchedule/Sqs/Worker.php +++ b/src/AutoSchedule/Sqs/Worker.php @@ -1,4 +1,5 @@ _create(TypeInterface::class, $job); + $this->_create(TypeInterface::class, $jobType); return $this; } @@ -29,7 +29,7 @@ public function hasJobType(): bool return $this->_exists(TypeInterface::class); } - protected function _unsetJobType() + protected function _unsetJobType(): self { $this->_delete(TypeInterface::class); diff --git a/src/Data/Job/TypeInterface.php b/src/Data/Job/TypeInterface.php index cbc06168..793f81c8 100644 --- a/src/Data/Job/TypeInterface.php +++ b/src/Data/Job/TypeInterface.php @@ -4,7 +4,6 @@ namespace NHDS\Jobs\Data\Job; use NHDS\Jobs\Db\ModelInterface; -use NHDS\Jobs\ProcessInterface; interface TypeInterface extends ModelInterface { diff --git a/src/Process/Forked.php b/src/Process/Forked.php index 371a0f17..778b90cf 100644 --- a/src/Process/Forked.php +++ b/src/Process/Forked.php @@ -18,14 +18,13 @@ public function start(): ProcessInterface $this->_create(self::PROP_HAS_FORKED, true); $processId = $this->_getProcessStrategy()->fork(); if ($processId === self::FORK_FAILURE_CODE) { - throw new \RuntimeException('Failed to fork new process.'); + throw new \RuntimeException('Failed to fork a new process.'); }elseif ($processId > 0) { // This is executed in the parent process. - $this->_initialize($processId); - $this->_getLogger()->debug("Forked Process[{$this->getProcessId()}][{$this->getTypeCode()}]."); + $this->_setProcessId($processId); }else { // This is executed in the child process. - $this->_initialize($processId); + $this->_initialize(); $this->_removeParentProcessPool(); $this->_startProcessPool(); } @@ -53,9 +52,10 @@ protected function _startProcessPool(): Forked public function processPoolStarted(): ProcessInterface { $this->_getLogger()->debug("Running Process..."); + $this->_getProcessSignal()->unBlock(); $this->_run(); $this->_getLogger()->debug("Process finished running."); - $this->_exit(0); + $this->exit(0); return $this; } diff --git a/src/Process/Pool.php b/src/Process/Pool.php index 7be6476c..c1134dd2 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -14,8 +14,6 @@ class Pool extends PoolAbstract implements PoolInterface protected $_waitSignals = [ SIGCHLD, SIGALRM, - SIGINT, - SIGTERM, ]; public function start(): PoolInterface @@ -24,45 +22,40 @@ public function start(): PoolInterface $this->_create(self::PROP_STARTED, true); $this->_initialize(); $this->_getLogger()->info("Process pool started."); - // Register signals to be handled. - pcntl_sigprocmask(SIG_BLOCK, $this->_waitSignals); - while (true) { - $this->getProcess()->processPoolStarted(); - $this->_getLogger()->debug("Waiting for signal..."); - $this->_signalInformation = []; - pcntl_sigwaitinfo($this->_waitSignals, $this->_signalInformation); - $signalNumber = $this->_signalInformation[self::SIGNAL_NUMBER]; - $this->_getLogger()->debug("Received signal($signalNumber)."); - switch ($signalNumber) { - case SIGCHLD: - $this->_childExitSignal(); - break; - case SIGALRM: - $this->_alarmSignal(); - break; - case SIGINT: - case SIGTERM: - $this->_getLogger()->debug('Handling termination signal...'); - $this->terminateChildProcesses(); - break 2; - default: - throw new \UnexpectedValueException('Unexpected blocked signal.'); - } - } + $this->getProcess()->processPoolStarted(); - $this->_getLogger()->info('Exiting process pool.'); + return $this; + } + + public function waitForSignal(): PoolInterface + { + $this->_getLogger()->debug("Waiting for signal..."); + $this->_signalInformation = []; + pcntl_sigwaitinfo($this->_waitSignals, $this->_signalInformation); + $signalNumber = $this->_signalInformation[self::SIGNAL_NUMBER]; + $this->_getLogger()->debug("Received signal number[$signalNumber]."); + switch ($signalNumber) { + case SIGCHLD: + $this->childExitSignal(); + break; + case SIGALRM: + $this->alarmSignal(); + break; + default: + throw new \UnexpectedValueException("Unexpected signal number [$signalNumber]."); + } return $this; } - protected function _childExitSignal(): PoolInterface + public function childExitSignal(): PoolInterface { while ($childProcessId = pcntl_wait($status, WNOHANG)) { if ($childProcessId == -1) { $this->_processControlWaitError(); } $childProcessExitCode = pcntl_wexitstatus($status); - $this->_getLogger()->debug("Process[$childProcessId] exited with code [$childProcessExitCode]"); + $this->_getLogger()->debug("Process[$childProcessId] exited with code [$childProcessExitCode]."); $childProcess = $this->getChildProcess($childProcessId)->setExitCode($childProcessExitCode); $this->_getProcessPoolStrategy()->childProcessExited($childProcess); $this->_validateAlarm(); @@ -89,12 +82,16 @@ protected function _processControlWaitError() public function addChildProcess(ProcessInterface $childProcess): PoolInterface { + $this->_getProcessSignal()->block(); if ($this->isFull()) { throw new \LogicException('Process pool is full.'); }else { $childProcess->start(); $this->_childProcesses[$childProcess->getProcessId()] = $childProcess; + $message = "Forked Process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; + $this->_getLogger()->debug($message); } + $this->_getProcessSignal()->unBlock(); return $this; } @@ -128,6 +125,7 @@ public function freeChildProcess(int $childProcessId): PoolInterface public function terminateChildProcesses(): PoolInterface { + $this->_getProcessSignal()->block(); if (!empty($this->_childProcesses)) { $numberOfProcesses = $this->getCountOfChildProcesses(); $this->_getLogger()->debug("Sending termination signal to $numberOfProcesses child processes..."); @@ -142,6 +140,7 @@ public function terminateChildProcesses(): PoolInterface unset($this->_childProcesses[$processId]); } } + $this->_getProcessSignal()->unBlock(); return $this; } diff --git a/src/Process/Pool/Server.php b/src/Process/Pool/Server.php index a9c64e0d..554d4e82 100644 --- a/src/Process/Pool/Server.php +++ b/src/Process/Pool/Server.php @@ -20,18 +20,13 @@ class Server extends ProcessAbstract implements ServerInterface public function start(): ProcessInterface { - $this->_initialize(0); + $this->_initialize(); $this->_getLogger()->info('Starting process pool server...'); if ($this->_getSemaphore()->testAndSetLock($this->_getServerSemaphoreResource())) { $this->_getLogger()->info('Process pool server started.'); $this->setProcessPool($this->_getProcessPoolFactory()->create()); $this->_getProcessPool()->setProcess($this); $this->_getProcessPool()->start(); - $this->_getProcessPool()->emptyChildProcesses(); - $this->_unsetProcessPool(); - $this->_getLogger()->info('Stopping process pool server.'); - $this->_getSemaphore()->releaseLock($this->_getServerSemaphoreResource()); - $this->_getLogger()->info('Process pool server stopped.'); }else { $this->_getLogger()->info('Cannot obtain process pool server mutex. Quitting.'); } @@ -46,6 +41,10 @@ protected function _getServerSemaphoreResource(): Semaphore\ResourceInterface public function processPoolStarted(): ProcessInterface { + while (true) { + $this->_getProcessPool()->waitForSignal(); + } + return $this; } } \ No newline at end of file diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index acb81e03..27c2a4e2 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -13,6 +13,7 @@ abstract class PoolAbstract implements PoolInterface use Process\Pool\Logger\AwareTrait; use Process\Pool\Strategy\AwareTrait; use Process\AwareTrait; + use Process\Signal\AwareTrait; public function hasAlarm(): bool { @@ -52,13 +53,12 @@ public function isFull(): bool protected function _initialize(): PoolInterface { - register_shutdown_function([$this, 'terminateChildProcesses']); $this->_getProcessPoolStrategy()->initializePool(); return $this; } - protected function _alarmSignal(): PoolInterface + public function alarmSignal(): PoolInterface { $this->_getProcessPoolStrategy()->receivedAlarm(); diff --git a/src/Process/PoolInterface.php b/src/Process/PoolInterface.php index 49fce8d6..af25834c 100644 --- a/src/Process/PoolInterface.php +++ b/src/Process/PoolInterface.php @@ -35,4 +35,6 @@ public function getCountOfChildProcesses(): int; public function setProcess(ProcessInterface $process); public function getProcess(): ProcessInterface; + + public function waitForSignal(): PoolInterface; } \ No newline at end of file diff --git a/src/Process/Root.php b/src/Process/Root.php index 19359036..e6e982a4 100644 --- a/src/Process/Root.php +++ b/src/Process/Root.php @@ -16,11 +16,10 @@ public function __construct() protected function _run(): Forked { - return $this; - } + while (true) { + $this->_getProcessPool()->waitForSignal(); + } - public function processPoolStarted(): ProcessInterface - { return $this; } } \ No newline at end of file diff --git a/src/Process/Signal.php b/src/Process/Signal.php new file mode 100644 index 00000000..5010cd9a --- /dev/null +++ b/src/Process/Signal.php @@ -0,0 +1,50 @@ +_blockedSignalNumbers)) { + pcntl_async_signals(true); + $this->_blockedSignalNumbers = self::DEFAULT_BLOCKED_SIGNAL_NUMBERS; + } + + return $this->_blockedSignalNumbers; + } + + public function addBlockedSignalNumber(int $signalNumber): SignalInterface + { + $this->_blockedSignalNumbers[$signalNumber] = $signalNumber; + + return $this; + } + + public function addSignalHandler(int $signalNumber, callable $signalHandler): SignalInterface + { + pcntl_signal($signalNumber, $signalHandler); + + return $this; + } + + public function block(): SignalInterface + { + pcntl_sigprocmask(SIG_SETMASK, array_keys($this->_getBlockingSignalNumbers())); + $this->_isBlocked = true; + + return $this; + } + + public function unBlock(): SignalInterface + { + $this->_isBlocked = false; + pcntl_sigprocmask(SIG_SETMASK, self::DEFAULT_BLOCKED_SIGNAL_NUMBERS); + + return $this; + } +} \ No newline at end of file diff --git a/src/Process/Signal/AwareTrait.php b/src/Process/Signal/AwareTrait.php new file mode 100644 index 00000000..23ad7c79 --- /dev/null +++ b/src/Process/Signal/AwareTrait.php @@ -0,0 +1,38 @@ +_create(SignalInterface::class, $processSignal); + + return $this; + } + + protected function _getProcessSignal(): SignalInterface + { + return $this->_read(SignalInterface::class); + } + + protected function _getProcessSignalClone(): SignalInterface + { + return clone $this->_getProcessSignal(); + } + + protected function _hasProcessSignal(): bool + { + return $this->_exists(SignalInterface::class); + } + + protected function _unsetProcessSignal(): self + { + $this->_delete(SignalInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Process/SignalInterface.php b/src/Process/SignalInterface.php new file mode 100644 index 00000000..d4caec62 --- /dev/null +++ b/src/Process/SignalInterface.php @@ -0,0 +1,20 @@ +_setParentProcessId(posix_getppid()); - $this->_setProcessId(posix_getpid()); - $this->_getLogger()->setProcess($this); - $this->_registerSignalHandlers(); - $this->_setProcessTitle(); - $this->_getProcessRegistry()->pushProcess($this); - }else { - $this->_setProcessId($processId); - } + protected function _initialize(): ProcessAbstract + { + $this->_setParentProcessId(posix_getppid()); + $this->_setProcessId(posix_getpid()); + $this->_getLogger()->setProcess($this); + $this->_setProcessTitle(); + $this->_getProcessRegistry()->pushProcess($this); + $this->_registerSignalHandlers(); return $this; } @@ -38,19 +35,55 @@ abstract public function processPoolStarted(): ProcessInterface; protected function _setProcessTitle(): ProcessInterface { $this->_create(self::PROP_IS_PROCESS_TITLE_SET, true); - cli_set_process_title($this->getPath()); + cli_set_process_title($this->_getTitlePrefix() . $this->getPath()); + + return $this; + } + + public function setTitlePrefix(string $titlePrefix): ProcessInterface + { + $this->_create(self::PROP_TITLE_PREFIX, $titlePrefix); return $this; } + protected function _getTitlePrefix(): string + { + return $this->_read(self::PROP_TITLE_PREFIX); + } + protected function _registerSignalHandlers(): ProcessInterface { - pcntl_signal(SIGTERM, [$this, 'receivedSignal']); - pcntl_signal(SIGINT, [$this, 'receivedSignal']); + $this->_getProcessSignal()->addBlockedSignalNumber(SIGTERM); + $this->_getProcessSignal()->addBlockedSignalNumber(SIGINT); + $this->_getProcessSignal()->addBlockedSignalNumber(SIGHUP); + $this->_getProcessSignal()->addBlockedSignalNumber(SIGQUIT); + $this->_getProcessSignal()->addBlockedSignalNumber(SIGABRT); + $this->_getProcessSignal()->block(); + $this->_getProcessSignal()->addSignalHandler(SIGTERM, [$this, 'receivedSignal']); + $this->_getProcessSignal()->addSignalHandler(SIGINT, [$this, 'receivedSignal']); + $this->_getProcessSignal()->addSignalHandler(SIGHUP, [$this, 'receivedSignal']); + $this->_getProcessSignal()->addSignalHandler(SIGQUIT, [$this, 'receivedSignal']); + $this->_getProcessSignal()->addSignalHandler(SIGABRT, [$this, 'receivedSignal']); return $this; } + public function receivedSignal(int $signalNumber, $signalInformation) + { + $this->_getProcessSignal()->block(); + $this->_getLogger()->debug("Received signal number[$signalNumber]."); + $this->exit($signalNumber); + } + + public function exit(int $exitCode) + { + $this->_getProcessSignal()->block(); + $this->_getProcessPool()->terminateChildProcesses(); + $this->_getLogger()->debug("Exiting Process."); + exit($exitCode); + } + public function setParentProcessPath(string $parentProcessPath): ProcessInterface { $this->_create(self::PROP_PARENT_PROCESS_PATH, $parentProcessPath); @@ -132,12 +165,6 @@ public function getExitCode(): int return $this->_read(self::PROP_EXIT_CODE); } - public function receivedSignal() - { - $this->_getLogger()->debug("Received signal."); - $this->_exit(0); - } - public function setTerminationSignalNumber(int $terminationSignalNumber): ProcessInterface { $this->_create(self::PROP_TERMINATION_SIGNAL_NUMBER, $terminationSignalNumber); @@ -201,10 +228,4 @@ protected function _getUuidMaximumInteger(): int { return $this->_read(self::PROP_UUID_MAXIMUM_INTEGER); } - - protected function _exit(int $exitCode) - { - $this->_getLogger()->debug("Exiting Process."); - exit($exitCode); - } } \ No newline at end of file diff --git a/src/ProcessInterface.php b/src/ProcessInterface.php index 08625b97..ad053606 100644 --- a/src/ProcessInterface.php +++ b/src/ProcessInterface.php @@ -41,7 +41,7 @@ public function setTypeCode(string $typeCode): ProcessInterface; public function setProcessPool(PoolInterface $pool); - public function receivedSignal(); + public function receivedSignal(int $signalNumber, $signalInformation); public function setParentProcessPath(string $parentProcessPath): ProcessInterface; @@ -64,4 +64,6 @@ public function getParentProcessTerminationSignalNumber(); public function setParentProcessTerminationSignalNumber(int $parentProcessTerminationSignalNumber); public function processPoolStarted(): ProcessInterface; + + public function exit(int $exitCode); } \ No newline at end of file diff --git a/src/Service/Create.php b/src/Service/Create.php index 156a5464..52a0cd19 100644 --- a/src/Service/Create.php +++ b/src/Service/Create.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Service; -use NHDS\Jobs\Api\Service\CreateInterface; +use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\ServiceAbstract; use NHDS\Jobs\State; use NHDS\Jobs\Type; diff --git a/src/Service/Create/AwareTrait.php b/src/Service/Create/AwareTrait.php index 1f382d47..8b600f8e 100644 --- a/src/Service/Create/AwareTrait.php +++ b/src/Service/Create/AwareTrait.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Service\Create; -use NHDS\Jobs\Api\Service\CreateInterface; +use NHDS\Jobs\Service\CreateInterface; trait AwareTrait { diff --git a/src/Service/Create/Factory.php b/src/Service/Create/Factory.php index 2051c6e8..94139a08 100644 --- a/src/Service/Create/Factory.php +++ b/src/Service/Create/Factory.php @@ -4,7 +4,7 @@ namespace NHDS\Jobs\Service\Create; use NHDS\Jobs\Api\Service\Create\FactoryInterface; -use NHDS\Jobs\Api\Service\CreateInterface; +use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\State\Service; use NHDS\Jobs\Service\FactoryAbstract; use NHDS\Jobs\Service\Create; diff --git a/src/Api/Service/CreateInterface.php b/src/Service/CreateInterface.php similarity index 86% rename from src/Api/Service/CreateInterface.php rename to src/Service/CreateInterface.php index 8d9a9221..74ba4704 100644 --- a/src/Api/Service/CreateInterface.php +++ b/src/Service/CreateInterface.php @@ -1,7 +1,7 @@ _create(self::PROP_DATE_TIME, $dateTime); + + return $this; } protected function _getDateTime(): \DateTime diff --git a/src/Type/Service/Create/AwareTrait.php b/src/Type/Service/Create/AwareTrait.php new file mode 100644 index 00000000..150cc385 --- /dev/null +++ b/src/Type/Service/Create/AwareTrait.php @@ -0,0 +1,33 @@ +_create(CreateInterface ::class, $create); + + return $this; + } + + protected function _getTypeServiceCreate(): CreateInterface + { + return $this->_read(CreateInterface ::class); + } + + protected function _getTypeServiceCreateClone(): CreateInterface + { + return clone $this->_getServiceCreate(); + } + + protected function _unsetTypeServiceCreate() + { + $this->_delete(CreateInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Type/Service/Create/Factory.php b/src/Type/Service/Create/Factory.php new file mode 100644 index 00000000..75290531 --- /dev/null +++ b/src/Type/Service/Create/Factory.php @@ -0,0 +1,21 @@ +_getTypeServiceCreateClone(); + + return $create; + } +} \ No newline at end of file diff --git a/src/Type/Service/CreateInterface.php b/src/Type/Service/CreateInterface.php index 69b1ac0f..90dd6c67 100644 --- a/src/Type/Service/CreateInterface.php +++ b/src/Type/Service/CreateInterface.php @@ -7,4 +7,25 @@ interface CreateInterface extends Type\ServiceInterface { + public function setCode(string $code): CreateInterface; + + public function setWorkerClassUri(string $workerModelUri): CreateInterface; + + public function setWorkerMethod(string $workerMethod): CreateInterface; + + public function setName(string $name): CreateInterface; + + public function setCronExpression(string $cronExpression): CreateInterface; + + public function setCanWorkInParallel(bool $canWorkInParallel): CreateInterface; + + public function setDefaultImportance(int $defaultImportance): CreateInterface; + + public function setScheduleLimit(int $scheduleLimit): CreateInterface; + + public function setIsEnabled(bool $isEnabled): CreateInterface; + + public function setAutoCompleteSuccess(bool $autoCompleteSuccess): CreateInterface; + + public function setAutoDeleteIntervalDuration(string $autoDeleteIntervalDuration): CreateInterface; } \ No newline at end of file diff --git a/src/Worker/Job/Service.php b/src/Worker/Job/Service.php index d2cc72f0..e8cbc258 100644 --- a/src/Worker/Job/Service.php +++ b/src/Worker/Job/Service.php @@ -4,7 +4,7 @@ namespace NHDS\Jobs\Worker\Job; use NHDS\Jobs\Data\Job; -use NHDS\Jobs\Api\Service\CreateInterface; +use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\Service\Update; use NHDS\Jobs\Api\Service\Create; use NHDS\Toolkit\Data\Property\Strict; @@ -36,6 +36,8 @@ public function requestRetry(\DateTime $retryDateTime): ServiceInterface protected function _updateOrInsertDateTime(\DateTime $dateTime): Service { $this->_createOrUpdate(self::PROP_RETRY_DATE_TIME, $dateTime); + + return $this; } protected function _getDateTime(): \DateTime diff --git a/src/Worker/Job/ServiceInterface.php b/src/Worker/Job/ServiceInterface.php index a6a036d3..4c1e7e5a 100644 --- a/src/Worker/Job/ServiceInterface.php +++ b/src/Worker/Job/ServiceInterface.php @@ -4,7 +4,7 @@ namespace NHDS\Jobs\Worker\Job; use NHDS\Jobs\Api\Service\Create\FactoryInterface; -use NHDS\Jobs\Api\Service\CreateInterface; +use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\Service\Update\Hold; use NHDS\Jobs\Service\Update\Retry; use NHDS\Jobs\Service\Update\Complete\Success; diff --git a/src/config/Process.yml b/src/config/Process.yml new file mode 100644 index 00000000..b062ac00 --- /dev/null +++ b/src/config/Process.yml @@ -0,0 +1,2 @@ +parameters: + process.title.prefix: 'nhds-jobs: ' \ No newline at end of file diff --git a/src/config/Process/Job.yml b/src/config/Process/Job.yml index 87934750..688839fc 100644 --- a/src/config/Process/Job.yml +++ b/src/config/Process/Job.yml @@ -15,5 +15,7 @@ services: - [setUuidMaximumInteger, [9999999999]] - [setProcessRegistry, ['@process.registry']] - [setProcessPoolFactory, ['@process.pool.factory-job']] + - [setProcessSignal, ['@process.signal']] + - [setTitlePrefix, ['%process.title.prefix%']] process.job: alias: nhds.jobs.process.job \ No newline at end of file diff --git a/src/config/Process/Job/Required.yml b/src/config/Process/Job/Required.yml index 23d16881..1f4bdec9 100644 --- a/src/config/Process/Job/Required.yml +++ b/src/config/Process/Job/Required.yml @@ -15,5 +15,7 @@ services: - [setUuidMaximumInteger, [9999999999]] - [setProcessRegistry, ['@process.registry']] - [setProcessPoolFactory, ['@process.pool.factory-job']] + - [setProcessSignal, ['@process.signal']] + - [setTitlePrefix, ['%process.title.prefix%']] process.job.required: alias: nhds.jobs.process.job.required \ No newline at end of file diff --git a/src/config/Process/Listener/Command.yml b/src/config/Process/Listener/Command.yml index f2bca2e6..46faf8ff 100644 --- a/src/config/Process/Listener/Command.yml +++ b/src/config/Process/Listener/Command.yml @@ -13,5 +13,7 @@ services: - [setTerminationSignalNumber, ['@=constant("SIGKILL")']] - [setUuidMaximumInteger, [9999999999]] - [setProcessPoolFactory, ['@process.pool.factory-empty']] + - [setProcessSignal, ['@process.signal']] + - [setTitlePrefix, ['%process.title.prefix%']] process.listener.command: alias: nhds.jobs.process.listener.command \ No newline at end of file diff --git a/src/config/Process/Listener/Mutex/Redis.yml b/src/config/Process/Listener/Mutex/Redis.yml index bb344d67..af6d0686 100644 --- a/src/config/Process/Listener/Mutex/Redis.yml +++ b/src/config/Process/Listener/Mutex/Redis.yml @@ -14,6 +14,8 @@ services: - [setBrokerTypeCode, ['process.listener.mutex.redis']] - [setProcessPoolFactory, ['@process.pool.factory-empty']] - [setRedisFactory, ['@redis.factory']] + - [setProcessSignal, ['@process.signal']] + - [setTitlePrefix, ['%process.title.prefix%']] process.listener.mutex.redis: alias: nhds.jobs.process.listener.mutex.redis public: false \ No newline at end of file diff --git a/src/config/Process/Pool.yml b/src/config/Process/Pool.yml index 5e3c2960..e9592564 100644 --- a/src/config/Process/Pool.yml +++ b/src/config/Process/Pool.yml @@ -4,5 +4,6 @@ services: shared: false calls: - [setLogger, ['@process.pool.logger']] + - [setProcessSignal, ['@process.signal']] process.pool: alias: nhds.jobs.process.pool \ No newline at end of file diff --git a/src/config/Process/Pool/Server.yml b/src/config/Process/Pool/Server.yml index 98893da3..9c044766 100644 --- a/src/config/Process/Pool/Server.yml +++ b/src/config/Process/Pool/Server.yml @@ -11,6 +11,8 @@ services: - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] - [setProcessRegistry, ['@process.registry']] + - [setProcessSignal, ['@process.signal']] + - [setTitlePrefix, ['%process.title.prefix%']] process.pool.server: public: true alias: nhds.jobs.process.pool.server \ No newline at end of file diff --git a/src/config/Process/Root.yml b/src/config/Process/Root.yml index e9ba8fb3..15af96d2 100644 --- a/src/config/Process/Root.yml +++ b/src/config/Process/Root.yml @@ -8,5 +8,7 @@ services: - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] - [setProcessRegistry, ['@process.registry']] + - [setProcessSignal, ['@process.signal']] + - [setTitlePrefix, ['%process.title.prefix%']] process.root: alias: nhds.jobs.process.root \ No newline at end of file diff --git a/src/config/Process/Signal.yml b/src/config/Process/Signal.yml new file mode 100644 index 00000000..c8e1b4d0 --- /dev/null +++ b/src/config/Process/Signal.yml @@ -0,0 +1,8 @@ +services: + nhds.jobs.process.signal: + class: NHDS\Jobs\Process\Signal + public: false + shared: true + process.signal: + alias: nhds.jobs.process.signal + public: false \ No newline at end of file diff --git a/src/config/root.yml b/src/config/root.yml index e3ef5640..470767f4 100644 --- a/src/config/root.yml +++ b/src/config/root.yml @@ -71,6 +71,8 @@ imports: - { resource: Semaphore.yml } # Process. + - { resource: Process.yml } + - { resource: Process/Signal.yml } - { resource: Process/Root.yml } - { resource: Process/Registry.yml } - { resource: Process/Job.yml } From 582978d5c5670b1d12624f18471fd8b527c71755 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 28 Mar 2018 10:06:21 -0500 Subject: [PATCH 05/44] changes from feedback and bug fixes - versioned APIs - refactored CacheItemPool and Redis actors to full repo / factory models. \Redis creates artifacts upon instantiation that relate to connections or sockets etc, that carry over a pcntl_fork, even if the call to connect() is deferred. - moved redis env properties to env parameters - heading in that direction for all env related DI - making updates to explicit DI shared and public directives - moving to abstract DI YAML files that hold properties for implementation and over abstractions - removed superfluous debug logging now that we have a pcntl_fork tolerant version of XDebug - ty Derick R! - updated the message broker to use factories and repos - continuing to standardize AwareTraits. - handling termination signal type requests in the pool as well as process models since the pool can block with pcntl_sigwaitinfo and the signal peeled off the stack could be a termination signal type. - using the UUID of the current process to ensure that repositories instantiate new \Redis objects for every process frame (will be used for all objects that deal with connections) - updated the scheduler and scheduler cache to use the repos and factories. - updated the redis mutex to use repos and remove debug logging. --- .../Service/Create/Factory/AwareTrait.php | 4 +- .../Service/Create/FactoryInterface.php | 2 +- .../Service/Create/Factory/AwareTrait.php | 4 +- .../Type/Service/Create/FactoryInterface.php | 2 +- .../Worker/Job/Service/AwareTrait.php | 4 +- .../{ => V1}/Worker/Job/ServiceInterface.php | 2 +- src/CacheItemPool/AwareTrait.php | 38 --------------- src/CacheItemPool/Factory.php | 8 +++- src/CacheItemPool/FactoryInterface.php | 3 ++ src/CacheItemPool/Repository.php | 7 ++- src/CacheItemPool/RepositoryInterface.php | 2 + src/Foreman.php | 1 - src/Maintainer.php | 2 - src/Maintainer/Delete.php | 1 - src/Message/Broker/BrokerAbstract.php | 42 ---------------- src/Message/Broker/BrokerInterface.php | 4 -- src/Message/Broker/Redis.php | 7 ++- src/Process/Forked.php | 2 - src/Process/Listener/Command.php | 1 - src/Process/Listener/Mutex/Redis.php | 1 - src/Process/Pool.php | 28 ++++++----- src/Process/Pool/Strategy.php | 13 +---- src/Process/PoolAbstract.php | 2 +- src/Process/Registry/AwareTrait.php | 9 +++- src/Process/SignalInterface.php | 2 +- src/ProcessAbstract.php | 5 +- src/Redis/AwareTrait.php | 36 -------------- src/Redis/Factory.php | 2 - src/Redis/FactoryInterface.php | 2 - src/Redis/Repository.php | 7 ++- src/Redis/Repository/AwareTrait.php | 38 +++++++++++++++ src/Redis/RepositoryInterface.php | 15 ++++++ src/RepositoryInterface.php | 9 ++++ src/Scheduler.php | 4 +- src/Scheduler/Cache.php | 6 +-- src/Scheduler/CacheInterface.php | 5 +- src/Semaphore/Mutex/Flock.php | 2 - src/Semaphore/Mutex/Redis.php | 48 +++++++------------ src/Service/Create.php | 1 - src/Service/Create/Factory.php | 2 +- src/Type/Service/Create/Factory.php | 2 +- src/Worker/Bootstrap.php | 2 - src/Worker/Job/Service.php | 4 +- src/Worker/Job/ServiceInterface.php | 2 +- src/config/CacheItemPool/Factory.yml | 10 ++++ src/config/CacheItemPool/Repository.yml | 11 +++++ src/config/Foreman.yml | 4 +- src/config/Maintainer.yml | 4 +- src/config/Message/Broker/Redis.yml | 6 +-- src/config/Redis.yml | 3 ++ src/config/Redis/Factory.yml | 7 +-- src/config/Redis/Repository.yml | 11 +++++ src/config/Scheduler.yml | 4 +- src/config/Scheduler/Cache.yml | 2 +- src/config/Selector.yml | 4 +- src/config/Semaphore.yml | 5 +- src/config/Semaphore/Mutex/Redis.yml | 2 +- src/config/dependencies.yml | 9 ---- src/config/root.yml | 5 ++ 59 files changed, 217 insertions(+), 253 deletions(-) rename src/Api/{ => V1}/Service/Create/Factory/AwareTrait.php (86%) rename src/Api/{ => V1}/Service/Create/FactoryInterface.php (94%) rename src/Api/{ => V1}/Type/Service/Create/Factory/AwareTrait.php (85%) rename src/Api/{ => V1}/Type/Service/Create/FactoryInterface.php (81%) rename src/Api/{ => V1}/Worker/Job/Service/AwareTrait.php (87%) rename src/Api/{ => V1}/Worker/Job/ServiceInterface.php (95%) delete mode 100644 src/CacheItemPool/AwareTrait.php delete mode 100644 src/Redis/AwareTrait.php create mode 100644 src/Redis/Repository/AwareTrait.php create mode 100644 src/Redis/RepositoryInterface.php create mode 100644 src/RepositoryInterface.php create mode 100644 src/config/CacheItemPool/Factory.yml create mode 100644 src/config/CacheItemPool/Repository.yml create mode 100644 src/config/Redis.yml create mode 100644 src/config/Redis/Repository.yml diff --git a/src/Api/Service/Create/Factory/AwareTrait.php b/src/Api/V1/Service/Create/Factory/AwareTrait.php similarity index 86% rename from src/Api/Service/Create/Factory/AwareTrait.php rename to src/Api/V1/Service/Create/Factory/AwareTrait.php index d7888347..5921b121 100644 --- a/src/Api/Service/Create/Factory/AwareTrait.php +++ b/src/Api/V1/Service/Create/Factory/AwareTrait.php @@ -1,9 +1,9 @@ _create(CacheItemPoolInterface::class, $cacheItemPool); - - return $this; - } - - protected function _getCacheItemPool(): CacheItemPoolInterface - { - return $this->_read(CacheItemPoolInterface::class); - } - - protected function _getCacheItemPoolClone(): CacheItemPoolInterface - { - return clone $this->_getCacheItemPool(); - } - - protected function _hasCacheItemPool(): bool - { - return $this->_exists(CacheItemPoolInterface::class); - } - - protected function _unsetCacheItemPool(): self - { - $this->_delete(CacheItemPoolInterface::class); - - return $this; - } -} \ No newline at end of file diff --git a/src/CacheItemPool/Factory.php b/src/CacheItemPool/Factory.php index fcb185a6..b8f700db 100644 --- a/src/CacheItemPool/Factory.php +++ b/src/CacheItemPool/Factory.php @@ -5,11 +5,17 @@ use Psr\Cache\CacheItemPoolInterface; use NHDS\Jobs\Service\FactoryAbstract; +use NHDS\Jobs\Redis; +use Symfony\Component\Cache\Adapter\RedisAdapter; class Factory extends FactoryAbstract implements FactoryInterface { + use Redis\Repository\AwareTrait; + public function create(): CacheItemPoolInterface { - // TODO: Implement create() method. + $redis = $this->_getRedisRepository()->getById(CacheItemPoolInterface::class); + + return new RedisAdapter($redis); } } \ No newline at end of file diff --git a/src/CacheItemPool/FactoryInterface.php b/src/CacheItemPool/FactoryInterface.php index 2db4a147..8bf63cc2 100644 --- a/src/CacheItemPool/FactoryInterface.php +++ b/src/CacheItemPool/FactoryInterface.php @@ -3,10 +3,13 @@ namespace NHDS\Jobs\CacheItemPool; +use NHDS\Jobs\Redis\RepositoryInterface; use NHDS\Jobs\Service; use Psr\Cache\CacheItemPoolInterface; interface FactoryInterface extends Service\FactoryInterface { public function create(): CacheItemPoolInterface; + + public function setRedisRepository(RepositoryInterface $redisRepository); } \ No newline at end of file diff --git a/src/CacheItemPool/Repository.php b/src/CacheItemPool/Repository.php index 5ff1d142..d2fec685 100644 --- a/src/CacheItemPool/Repository.php +++ b/src/CacheItemPool/Repository.php @@ -5,16 +5,21 @@ use NHDS\Jobs\CacheItemPool; use Psr\Cache\CacheItemPoolInterface; +use NHDS\Toolkit\Data\Property\Strict; +use NHDS\Jobs\Process; class Repository implements RepositoryInterface { + use Strict\AwareTrait; + use Process\Registry\AwareTrait; use CacheItemPool\Factory\AwareTrait; protected $_cacheItemPoolCollection = []; public function getById(string $id): CacheItemPoolInterface { + $id .= $this->_getProcessRegistry()->getLastRegisteredProcess()->getUuid(); if (!isset($this->_cacheItemPoolCollection[$id])) { - $this->_cacheItemPoolCollection[$id] = $this->_getCacheItemPoolFactory(); + $this->_cacheItemPoolCollection[$id] = $this->_getCacheItemPoolFactory()->create(); } return $this->_cacheItemPoolCollection[$id]; diff --git a/src/CacheItemPool/RepositoryInterface.php b/src/CacheItemPool/RepositoryInterface.php index 7d21b939..cdfd4522 100644 --- a/src/CacheItemPool/RepositoryInterface.php +++ b/src/CacheItemPool/RepositoryInterface.php @@ -8,4 +8,6 @@ interface RepositoryInterface { public function getById(string $id): CacheItemPoolInterface; + + public function setCacheItemPoolFactory(FactoryInterface $cacheItemPoolFactory); } \ No newline at end of file diff --git a/src/Foreman.php b/src/Foreman.php index 68fba1e6..c2ccd4a5 100644 --- a/src/Foreman.php +++ b/src/Foreman.php @@ -67,7 +67,6 @@ protected function _instantiateWorker(): ForemanInterface { $job = $this->_getJob(); try{ - $this->_getLogger()->debug('Instantiating Worker for Job[' . $job->getId() . '].'); call_user_func($this->_getLocator()->getCallable()); }catch(\Exception $exception){ $updateCrash = $this->_getServiceUpdateCrashFactory()->create(); diff --git a/src/Maintainer.php b/src/Maintainer.php index 5668d7ba..5b2d599b 100644 --- a/src/Maintainer.php +++ b/src/Maintainer.php @@ -41,7 +41,6 @@ public function rescheduleCrashedJobs(): MaintainerInterface $this->_rescheduleCrashedJobs(); $this->_getSemaphoreResource(self::SEMAPHORE_RESOURCE_NAME_RESCHEDULE_JOBS)->releaseLock(); }catch(\Exception $exception){ - $this->_getLogger()->debug('Received Exception with message "' . $exception->getMessage() . '"'); if ($this->_getSemaphoreResource(self::SEMAPHORE_RESOURCE_NAME_RESCHEDULE_JOBS)->hasLock()) { $this->_getSemaphoreResource(self::SEMAPHORE_RESOURCE_NAME_RESCHEDULE_JOBS)->releaseLock(); } @@ -64,7 +63,6 @@ protected function _rescheduleCrashedJobs(): Maintainer $jobSemaphoreResource->releaseLock(); } }catch(\Exception $exception){ - $this->_getLogger()->debug('Received Exception with message "' . $exception->getMessage() . '"'); if ($jobSemaphoreResource->hasLock()) { $jobSemaphoreResource->releaseLock(); } diff --git a/src/Maintainer/Delete.php b/src/Maintainer/Delete.php index e616b4a2..e7eb8751 100644 --- a/src/Maintainer/Delete.php +++ b/src/Maintainer/Delete.php @@ -26,7 +26,6 @@ public function deleteCompletedJobs(): DeleteInterface $this->_deleteCompletedJobs(); $this->_getSemaphoreResource(self::SEMAPHORE_RESOURCE_NAME_MAINTAINER_DELETE)->releaseLock(); }catch(\Exception $exception){ - $this->_getLogger()->debug('Received Exception with message "' . $exception->getMessage() . '"'); if ($this->_getSemaphoreResource(self::SEMAPHORE_RESOURCE_NAME_MAINTAINER_DELETE)->hasLock()) { $this->_getSemaphoreResource(self::SEMAPHORE_RESOURCE_NAME_MAINTAINER_DELETE)->releaseLock(); } diff --git a/src/Message/Broker/BrokerAbstract.php b/src/Message/Broker/BrokerAbstract.php index 0e5bd78d..631b7ebb 100644 --- a/src/Message/Broker/BrokerAbstract.php +++ b/src/Message/Broker/BrokerAbstract.php @@ -12,28 +12,6 @@ abstract class BrokerAbstract implements BrokerInterface use Logger\AwareTrait; protected $_publishChannelName; protected $_subscriptionChannelName; - protected $_host; - protected $_port; - - public function setHost(string $host): BrokerInterface - { - if ($this->_host === null) { - $this->_host = $host; - }else { - throw new \LogicException('Host is already set.'); - } - - return $this; - } - - protected function _getHost(): string - { - if ($this->_host === null) { - throw new \LogicException('Host is not set.'); - } - - return $this->_host; - } public function setSubscriptionChannelName(string $channelName): BrokerInterface { @@ -72,24 +50,4 @@ protected function _getPublishChannelName(): string return $this->_publishChannelName; } - - public function setPort(int $port): BrokerInterface - { - if ($this->_port === null) { - $this->_port = $port; - }else { - throw new \LogicException('Port is already set.'); - } - - return $this; - } - - protected function _getPort(): int - { - if ($this->_port === null) { - throw new \LogicException('Port is not set.'); - } - - return $this->_port; - } } \ No newline at end of file diff --git a/src/Message/Broker/BrokerInterface.php b/src/Message/Broker/BrokerInterface.php index 02ac79f3..16738900 100644 --- a/src/Message/Broker/BrokerInterface.php +++ b/src/Message/Broker/BrokerInterface.php @@ -17,11 +17,7 @@ public function getPublishChannelLength(): int; public function getSubscriptionChannelLength(): int; - public function setHost(string $host): BrokerInterface; - public function setSubscriptionChannelName(string $channelName): BrokerInterface; public function setPublishChannelName(string $channelName): BrokerInterface; - - public function setPort(int $port): BrokerInterface; } \ No newline at end of file diff --git a/src/Message/Broker/Redis.php b/src/Message/Broker/Redis.php index 7a71987a..5474a4a8 100644 --- a/src/Message/Broker/Redis.php +++ b/src/Message/Broker/Redis.php @@ -4,10 +4,12 @@ namespace NHDS\Jobs\Message\Broker; use NHDS\Jobs\Process\Pool\Logger; +use NHDS\Jobs\Redis\Repository; class Redis extends BrokerAbstract { use Logger\AwareTrait; + use Repository\AwareTrait; protected $_redisClient; public function waitForNewMessage(): BrokerInterface @@ -29,10 +31,7 @@ public function waitForNewMessage(): BrokerInterface protected function _getRedisClient(): \Redis { if ($this->_redisClient === null) { - $this->_redisClient = new \Redis(); - // Do not use pconnet. - $this->_redisClient->connect($this->_getHost(), $this->_getPort()); - $this->_redisClient->setOption(\Redis::OPT_READ_TIMEOUT, '-1'); + $this->_redisClient = $this->_getRedisRepository()->getById(BrokerInterface::class); } return $this->_redisClient; diff --git a/src/Process/Forked.php b/src/Process/Forked.php index 778b90cf..e2c1fd36 100644 --- a/src/Process/Forked.php +++ b/src/Process/Forked.php @@ -51,10 +51,8 @@ protected function _startProcessPool(): Forked public function processPoolStarted(): ProcessInterface { - $this->_getLogger()->debug("Running Process..."); $this->_getProcessSignal()->unBlock(); $this->_run(); - $this->_getLogger()->debug("Process finished running."); $this->exit(0); return $this; diff --git a/src/Process/Listener/Command.php b/src/Process/Listener/Command.php index e845ad67..c639eae6 100644 --- a/src/Process/Listener/Command.php +++ b/src/Process/Listener/Command.php @@ -36,7 +36,6 @@ public function processMessages(): ListenerInterface public function addProcess(string $processTypeCode): Command { - $this->_getLogger()->debug('Adding Process with type code "' . $processTypeCode . '".'); $process = $this->_getProcessCollection()->getProcessPrototypeClone($processTypeCode); $this->_getProcessPool()->addChildProcess($process); diff --git a/src/Process/Listener/Mutex/Redis.php b/src/Process/Listener/Mutex/Redis.php index 171fdbb4..f0d96f6e 100644 --- a/src/Process/Listener/Mutex/Redis.php +++ b/src/Process/Listener/Mutex/Redis.php @@ -23,7 +23,6 @@ protected function _run(): Forked protected function _register(): ProcessInterface { - $this->_getLogger()->debug("CLIENT SETNAME {$this->getParentProcessUuid()}"); $this->_getRedis()->client('SETNAME', $this->getParentProcessUuid()); $this->_getMessageBroker()->setPublishChannelName($this->getParentProcessUuid()); $this->_getMessageBroker()->setSubscriptionChannelName($this->getParentProcessUuid()); diff --git a/src/Process/Pool.php b/src/Process/Pool.php index c1134dd2..137cb955 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -14,14 +14,17 @@ class Pool extends PoolAbstract implements PoolInterface protected $_waitSignals = [ SIGCHLD, SIGALRM, + SIGTERM, + SIGINT, + SIGHUP, + SIGQUIT, + SIGABRT, ]; public function start(): PoolInterface { - $this->_getLogger()->debug("Starting process pool..."); $this->_create(self::PROP_STARTED, true); $this->_initialize(); - $this->_getLogger()->info("Process pool started."); $this->getProcess()->processPoolStarted(); return $this; @@ -29,11 +32,11 @@ public function start(): PoolInterface public function waitForSignal(): PoolInterface { - $this->_getLogger()->debug("Waiting for signal..."); + $this->_getLogger()->info("Waiting for signal..."); $this->_signalInformation = []; pcntl_sigwaitinfo($this->_waitSignals, $this->_signalInformation); $signalNumber = $this->_signalInformation[self::SIGNAL_NUMBER]; - $this->_getLogger()->debug("Received signal number[$signalNumber]."); + $this->_getLogger()->info("Received signal number[$signalNumber]."); switch ($signalNumber) { case SIGCHLD: $this->childExitSignal(); @@ -41,6 +44,13 @@ public function waitForSignal(): PoolInterface case SIGALRM: $this->alarmSignal(); break; + case SIGTERM: + case SIGINT: + case SIGHUP: + case SIGQUIT: + case SIGABRT: + $this->getProcess()->receivedSignal($signalNumber, $this->_signalInformation); + break; default: throw new \UnexpectedValueException("Unexpected signal number [$signalNumber]."); } @@ -55,12 +65,10 @@ public function childExitSignal(): PoolInterface $this->_processControlWaitError(); } $childProcessExitCode = pcntl_wexitstatus($status); - $this->_getLogger()->debug("Process[$childProcessId] exited with code [$childProcessExitCode]."); $childProcess = $this->getChildProcess($childProcessId)->setExitCode($childProcessExitCode); $this->_getProcessPoolStrategy()->childProcessExited($childProcess); $this->_validateAlarm(); } - $this->_getLogger()->debug('Number of child processes in pool: ' . $this->getCountOfChildProcesses()); $this->_getProcessPoolStrategy()->currentPendingChildExitsCompleted(); return $this; @@ -89,7 +97,7 @@ public function addChildProcess(ProcessInterface $childProcess): PoolInterface $childProcess->start(); $this->_childProcesses[$childProcess->getProcessId()] = $childProcess; $message = "Forked Process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; - $this->_getLogger()->debug($message); + $this->_getLogger()->info($message); } $this->_getProcessSignal()->unBlock(); @@ -110,7 +118,7 @@ public function freeChildProcess(int $childProcessId): PoolInterface if (isset($this->_childProcesses[$childProcessId])) { if ($this->_childProcesses[$childProcessId] instanceof ProcessInterface) { $typeCode = $this->_childProcesses[$childProcessId]->getTypeCode(); - $this->_getLogger()->debug("Freeing child process related to Process[$childProcessId][$typeCode]."); + $this->_getLogger()->info("Freeing child process related to Process[$childProcessId][$typeCode]."); unset($this->_childProcesses[$childProcessId]); }else { $message = "Process associated to Process[$childProcessId] is not an expected type."; @@ -127,8 +135,6 @@ public function terminateChildProcesses(): PoolInterface { $this->_getProcessSignal()->block(); if (!empty($this->_childProcesses)) { - $numberOfProcesses = $this->getCountOfChildProcesses(); - $this->_getLogger()->debug("Sending termination signal to $numberOfProcesses child processes..."); /** @var ProcessInterface $process */ foreach ($this->_childProcesses as $process) { $processId = $process->getProcessId(); @@ -136,7 +142,7 @@ public function terminateChildProcesses(): PoolInterface $processTypeCode = $process->getTypeCode(); posix_kill($processId, $terminationSignalNumber); $message = "Sent kill($terminationSignalNumber) to Process[$processId][$processTypeCode]."; - $this->_getLogger()->debug($message); + $this->_getLogger()->info($message); unset($this->_childProcesses[$processId]); } } diff --git a/src/Process/Pool/Strategy.php b/src/Process/Pool/Strategy.php index 569ff8b7..dceea30a 100644 --- a/src/Process/Pool/Strategy.php +++ b/src/Process/Pool/Strategy.php @@ -29,11 +29,9 @@ protected function _listenerProcessExited(ListenerInterface $listenerProcess): S if ($listenerProcess->getExitCode() !== 0) { $this->_pauseListenerProcess($listenerProcess); }else { - $this->_getLogger()->debug('Processing listener messages...'); while (!$this->_getProcessPool()->isFull() && $listenerProcess->hasMessages()) { $listenerProcess->processMessages(); } - $this->_getLogger()->debug('Finished processing listener messages.'); if ($this->_getProcessPool()->isFull()) { $this->_pauseListenerProcess($listenerProcess); @@ -69,9 +67,6 @@ protected function _jobProcessExited(JobInterface $jobProcess): Strategy { $this->_getProcessPool()->freeChildProcess($jobProcess->getProcessId()); if ($jobProcess->getExitCode() !== 0) { - $processId = $jobProcess->getProcessId(); - $this->_getLogger()->debug("Replacing process for exit error from Process[$processId]."); - $this->_getLogger()->debug("Throttling replacement process for Process[$processId]]."); $typeCode = $jobProcess->getTypeCode(); $replacementProcess = $this->_getProcessCollection()->getProcessPrototypeClone($typeCode); $replacementProcess->setThrottle($this->getChildProcessWaitThrottle()); @@ -86,11 +81,7 @@ protected function _jobProcessExited(JobInterface $jobProcess): Strategy public function receivedAlarm(): StrategyInterface { - $this->_getLogger()->debug("Received alarm signal."); - if ($this->_getProcessPool()->isFull()) { - $this->_getLogger()->notice("Process pool is full."); - $this->_getLogger()->notice("Could not allocate process for alarm signal."); - }else { + if (!$this->_getProcessPool()->isFull()) { if ($this->_hasPausedListenerProcess()) { $this->_unPauseListenerProcesses(); }else { @@ -128,7 +119,6 @@ protected function _pauseListenerProcess(ListenerInterface $listenerProcess): St { $listenerProcessId = $listenerProcess->getProcessId(); if (!isset($this->_pausedListenerProcesses[$listenerProcessId])) { - $this->_getLogger()->debug('Pausing Listener[' . $listenerProcessId . '].'); $this->_getProcessPool()->freeChildProcess($listenerProcessId); $this->_pausedListenerProcesses[$listenerProcessId] = $listenerProcess; }else { @@ -149,7 +139,6 @@ protected function _unPauseListenerProcesses(): Strategy foreach ($this->_pausedListenerProcesses as $processId => $listenerProcess) { if (!$this->_getProcessPool()->isFull()) { $typeCode = $listenerProcess->getTypeCode(); - $this->_getLogger()->debug('Un-pausing Listener[' . $processId . '][' . $typeCode . '].'); $newListenerProcess = $this->_getProcessCollection()->getProcessPrototypeClone($typeCode); while (!$this->_getProcessPool()->isFull() && $listenerProcess->hasMessages()) { $listenerProcess->processMessages(); diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index 27c2a4e2..8f2922ef 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -28,7 +28,7 @@ public function hasAlarm(): bool public function setAlarm(int $seconds): PoolInterface { - $this->_getLogger()->debug('Setting alarm for ' . $seconds . ' seconds.'); + $this->_getLogger()->info('Setting alarm for ' . $seconds . ' seconds.'); pcntl_alarm($seconds); return $this; diff --git a/src/Process/Registry/AwareTrait.php b/src/Process/Registry/AwareTrait.php index 0e2676ad..284ecd91 100644 --- a/src/Process/Registry/AwareTrait.php +++ b/src/Process/Registry/AwareTrait.php @@ -7,13 +7,18 @@ trait AwareTrait { - public function setProcessRegistry(RegistryInterface $registry) + public function setProcessRegistry(RegistryInterface $registry): self { $this->_create(RegistryInterface::class, $registry); return $this; } + public function hasProcessRegistry(): bool + { + $this->_exists(RegistryInterface::class); + } + protected function _getProcessRegistry(): RegistryInterface { return $this->_read(RegistryInterface::class); @@ -24,7 +29,7 @@ protected function _getProcessRegistryClone(): RegistryInterface return clone $this->_getProcessRegistry(); } - protected function _unsetProcessRegistry() + protected function _unsetProcessRegistry(): self { $this->_delete(RegistryInterface::class); diff --git a/src/Process/SignalInterface.php b/src/Process/SignalInterface.php index d4caec62..e5715802 100644 --- a/src/Process/SignalInterface.php +++ b/src/Process/SignalInterface.php @@ -6,7 +6,7 @@ interface SignalInterface { public const DEFAULT_BLOCKED_SIGNAL_NUMBERS = [ - SIGCHLD . + SIGCHLD, SIGALRM, ]; diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index 0dc466d5..8c440695 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -23,9 +23,9 @@ protected function _initialize(): ProcessAbstract $this->_setParentProcessId(posix_getppid()); $this->_setProcessId(posix_getpid()); $this->_getLogger()->setProcess($this); + $this->_registerSignalHandlers(); $this->_setProcessTitle(); $this->_getProcessRegistry()->pushProcess($this); - $this->_registerSignalHandlers(); return $this; } @@ -72,7 +72,6 @@ protected function _registerSignalHandlers(): ProcessInterface public function receivedSignal(int $signalNumber, $signalInformation) { $this->_getProcessSignal()->block(); - $this->_getLogger()->debug("Received signal number[$signalNumber]."); $this->exit($signalNumber); } @@ -80,7 +79,6 @@ public function exit(int $exitCode) { $this->_getProcessSignal()->block(); $this->_getProcessPool()->terminateChildProcesses(); - $this->_getLogger()->debug("Exiting Process."); exit($exitCode); } @@ -211,7 +209,6 @@ public function getUuid(): string . '-' . sprintf('%f', microtime(true)) . '-' . random_int(0, $this->_getUuidMaximumInteger()); $this->_create(self::PROP_UUID, $processUuid); - $this->_getLogger()->debug("Generated UUID[$processUuid]"); } return $this->_read(self::PROP_UUID); diff --git a/src/Redis/AwareTrait.php b/src/Redis/AwareTrait.php deleted file mode 100644 index c8a7b9b1..00000000 --- a/src/Redis/AwareTrait.php +++ /dev/null @@ -1,36 +0,0 @@ -_create(\Redis::class, $redis); - - return $this; - } - - protected function _hasRedis(): bool - { - return $this->_exists(\Redis::class); - } - - protected function _getRedis(): \Redis - { - return $this->_read(\Redis::class); - } - - protected function _getRedisClone(): \Redis - { - return clone $this->_getRedis(); - } - - protected function _unsetRedis(): self - { - $this->_delete(\Redis::class); - - return $this; - } -} \ No newline at end of file diff --git a/src/Redis/Factory.php b/src/Redis/Factory.php index e654a395..79ad268f 100644 --- a/src/Redis/Factory.php +++ b/src/Redis/Factory.php @@ -4,12 +4,10 @@ namespace NHDS\Jobs\Redis; use NHDS\Jobs\Service\FactoryAbstract; -use NHDS\Jobs\Redis; use NHDS\Toolkit\Data\Property\Strict; class Factory extends FactoryAbstract implements FactoryInterface { - use Redis\AwareTrait; use Strict\AwareTrait; protected $_options = []; diff --git a/src/Redis/FactoryInterface.php b/src/Redis/FactoryInterface.php index a3397152..bcc4c49f 100644 --- a/src/Redis/FactoryInterface.php +++ b/src/Redis/FactoryInterface.php @@ -17,6 +17,4 @@ public function setPort(int $port): FactoryInterface; public function setHost(string $host): FactoryInterface; public function addOption(int $optionName, string $optionValue): FactoryInterface; - - public function setRedis(\Redis $redis); } \ No newline at end of file diff --git a/src/Redis/Repository.php b/src/Redis/Repository.php index 1484220e..b3a3e917 100644 --- a/src/Redis/Repository.php +++ b/src/Redis/Repository.php @@ -4,14 +4,19 @@ namespace NHDS\Jobs\Redis; use NHDS\Jobs\Redis; +use NHDS\Jobs\Process; +use NHDS\Toolkit\Data\Property\Strict; -class Repository +class Repository implements RepositoryInterface { + use Strict\AwareTrait; use Redis\Factory\AwareTrait; + use Process\Registry\AwareTrait; protected $_redisCollection = []; public function getById(string $id): \Redis { + $id .= $this->_getProcessRegistry()->getLastRegisteredProcess()->getUuid(); if (!isset($this->_redisCollection[$id])) { $this->_redisCollection[$id] = $this->_getRedisFactory()->create(); } diff --git a/src/Redis/Repository/AwareTrait.php b/src/Redis/Repository/AwareTrait.php new file mode 100644 index 00000000..d503e5e0 --- /dev/null +++ b/src/Redis/Repository/AwareTrait.php @@ -0,0 +1,38 @@ +_create(RepositoryInterface::class, $redisRepository); + + return $this; + } + + protected function _getRedisRepository(): RepositoryInterface + { + return $this->_read(RepositoryInterface::class); + } + + protected function _getRedisRepositoryClone(): RepositoryInterface + { + return clone $this->_getRedisRepository(); + } + + protected function _hasRedisRepository(): bool + { + return $this->_exists(RepositoryInterface::class); + } + + protected function _unsetRedisRepository(): self + { + $this->_delete(RepositoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Redis/RepositoryInterface.php b/src/Redis/RepositoryInterface.php new file mode 100644 index 00000000..c1ead432 --- /dev/null +++ b/src/Redis/RepositoryInterface.php @@ -0,0 +1,15 @@ +format(self::DATE_TIME_FORMAT_CACHE_MINUTE); - $cacheItemPool = $this->_getCacheItemPool(); + $cacheItemPool = $this->_getCacheItemPoolRepository()->getById(self::CACHE_ITEM_POOL_ID); $hasItem = $cacheItemPool->hasItem(self::CACHE_SCHEDULED_AHEAD_KEY_PREFIX . $referenceMinuteDateTimeString); if ($hasItem) { $isMinuteScheduled = true; @@ -60,7 +60,7 @@ protected function _getScheduledKeyLifetime(): \DateTime public function cacheScheduledMinutes(\DateTime $scheduledMinute): CacheInterface { - $cacheItemPool = $this->_getCacheItemPool(); + $cacheItemPool = $this->_getCacheItemPoolRepository()->getById(self::CACHE_ITEM_POOL_ID); $cachedMinuteDateTimeString = $scheduledMinute->format(self::DATE_TIME_FORMAT_CACHE_MINUTE); $cacheItem = $cacheItemPool->getItem(self::CACHE_SCHEDULED_AHEAD_KEY_PREFIX . $cachedMinuteDateTimeString); $cacheItem->set(self::CACHE_SCHEDULED_AHEAD_VALUE); diff --git a/src/Scheduler/CacheInterface.php b/src/Scheduler/CacheInterface.php index d3578643..6d736265 100644 --- a/src/Scheduler/CacheInterface.php +++ b/src/Scheduler/CacheInterface.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Scheduler; -use Psr\Cache\CacheItemPoolInterface; +use NHDS\Jobs\CacheItemPool\RepositoryInterface; interface CacheInterface { @@ -12,8 +12,9 @@ interface CacheInterface const CACHE_SCHEDULED_AHEAD_KEY_PREFIX = 'schedule_'; const DATE_TIME_FORMAT_CACHE_MINUTE = 'Y_m_d_H_i'; const PROP_SCHEDULED_KEY_LIFETIME = 'scheduled_key_lifetime'; + public const CACHE_ITEM_POOL_ID = 'scheduler'; - public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool); + public function setCacheItemPoolRepository(RepositoryInterface $repository); public function getMinutesNotInCache(): array; diff --git a/src/Semaphore/Mutex/Flock.php b/src/Semaphore/Mutex/Flock.php index 25a8c3f1..3b3e6609 100644 --- a/src/Semaphore/Mutex/Flock.php +++ b/src/Semaphore/Mutex/Flock.php @@ -28,7 +28,6 @@ public function testAndSetLock(): bool { if ($this->_hasLock === false) { if (flock($this->_getLockFilePointer(), $this->_getFlockLockOperation()) === true) { - $this->_getLogger()->debug('Obtained lock for file "' . $this->_getFilePath() . '".'); $this->_hasLock = true; } }else { @@ -44,7 +43,6 @@ public function releaseLock(): MutexInterface if (flock($this->_getLockFilePointer(), LOCK_UN) === false) { $this->_throwNewFilesystemException(Runtime\Filesystem::CODE_UNLOCK_FAILED); } - $this->_getLogger()->debug('Released lock for file "' . $this->_getFilePath() . '".'); $this->_hasLock = false; if (fclose($this->_getLockFilePointer()) === false) { $this->_throwNewFilesystemException(Runtime\Filesystem::CODE_FCLOSE_FAILED); diff --git a/src/Semaphore/Mutex/Redis.php b/src/Semaphore/Mutex/Redis.php index 3612a29c..83413086 100644 --- a/src/Semaphore/Mutex/Redis.php +++ b/src/Semaphore/Mutex/Redis.php @@ -8,12 +8,14 @@ use NHDS\Toolkit\Data\Property\Strict; use NHDS\Jobs\Process\Pool\Logger; use NHDS\Jobs\Process; +use NHDS\Jobs\Redis\Repository; class Redis extends MutexAbstract implements RedisInterface { use Strict\AwareTrait; use Logger\AwareTrait; use Process\Registry\AwareTrait; + use Repository\AwareTrait; const PROP_REDIS = 'redis'; const PROP_KEY = 'key'; protected $_hasLock = false; @@ -21,15 +23,15 @@ class Redis extends MutexAbstract implements RedisInterface public function testAndSetLock(): bool { if ($this->_hasLock === false) { - $this->_getRedis()->watch($this->_getKey()); + $this->_getRedisClient()->watch($this->_getKey()); // If the mutex resource ID is set, then check if the owning client is connected. - $mutexKeyValue = $this->_getRedis()->get($this->_getKey()); + $mutexKeyValue = $this->_getRedisClient()->get($this->_getKey()); if (!empty($mutexKeyValue)) { $mutexClientIsConnected = false; // Get a list of connected clients. - $clients = $this->_getRedis()->client('LIST'); + $clients = $this->_getRedisClient()->client('LIST'); foreach ($clients as $client) { if ($client['name'] === $mutexKeyValue) { $mutexClientIsConnected = true; @@ -40,31 +42,23 @@ public function testAndSetLock(): bool // If the client that registered for the mutex resource ID is connected, the mutex is held by another client. if ($mutexClientIsConnected === false) { // If not, try to obtain the lock by registering on the mutex resource ID. - $this->_getRedis()->multi(); - $this->_getRedis()->set($this->_getKey(), $this->_getParentProcessUuid()); - $reply = $this->_getRedis()->exec(); + $this->_getRedisClient()->multi(); + $this->_getRedisClient()->set($this->_getKey(), $this->_getParentProcessUuid()); + $reply = $this->_getRedisClient()->exec(); // If the mutex resource ID was not set by another client, the mutex is obtained by this client. if ($reply[0] === true) { $this->_hasLock = true; - $this->_getLogger()->debug("Obtained mutex[{$this->_getKey()}]."); - }else { - $this->_getLogger()->debug("Did not obtain mutex[{$this->_getKey()}]."); } - }else { - $this->_getLogger()->debug("Did not obtain mutex[{$this->_getKey()}]."); } }else { // If the mutex resource ID is not set, try to obtain the mutex. - $this->_getRedis()->multi(); - $this->_getRedis()->set($this->_getKey(), $this->_getParentProcessUuid()); - $reply = $this->_getRedis()->exec(); + $this->_getRedisClient()->multi(); + $this->_getRedisClient()->set($this->_getKey(), $this->_getParentProcessUuid()); + $reply = $this->_getRedisClient()->exec(); if (is_array($reply) && $reply[0] === true) { $this->_hasLock = true; - $this->_getLogger()->debug("Obtained mutex[{$this->_getKey()}]."); - }elseif (is_bool($reply) && $reply === false) { - $this->_getLogger()->debug("Did not obtain mutex[{$this->_getKey()}]."); - }else { + }elseif ($reply !== false) { $type = gettype($reply); throw new \UnexpectedValueException("Reply is of type [$type]"); } @@ -79,8 +73,7 @@ public function testAndSetLock(): bool public function releaseLock(): MutexInterface { if ($this->_hasLock === true) { - $this->_getRedis()->del($this->_getKey()); - $this->_getLogger()->debug("Released mutex[{$this->_getKey()}]."); + $this->_getRedisClient()->del($this->_getKey()); $this->_hasLock = false; }else { throw new \LogicException('The mutex has not obtained a lock.'); @@ -109,23 +102,14 @@ protected function _getKey(): string return $this->_read(self::PROP_KEY); } - protected function _getRedis(): \Redis + protected function _getRedisClient(): \Redis { if (!$this->_exists(self::PROP_REDIS)) { - // Connect to Redis. - $redis = new \Redis(); - $redis->connect('redis'); - $redis->setOption(\Redis::OPT_READ_TIMEOUT, '-1'); + $redis = $this->_getRedisRepository()->getById(RedisInterface::class); + $this->_create(self::PROP_REDIS, $redis); } return $this->_read(self::PROP_REDIS); } - - public function setRedis(\Redis $redis): RedisInterface - { -// $this->_create(self::PROP_REDIS, $redis); - - return $this; - } } \ No newline at end of file diff --git a/src/Service/Create.php b/src/Service/Create.php index 52a0cd19..9b502793 100644 --- a/src/Service/Create.php +++ b/src/Service/Create.php @@ -3,7 +3,6 @@ namespace NHDS\Jobs\Service; -use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\ServiceAbstract; use NHDS\Jobs\State; use NHDS\Jobs\Type; diff --git a/src/Service/Create/Factory.php b/src/Service/Create/Factory.php index 94139a08..74367a61 100644 --- a/src/Service/Create/Factory.php +++ b/src/Service/Create/Factory.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Service\Create; -use NHDS\Jobs\Api\Service\Create\FactoryInterface; +use NHDS\Jobs\Api\V1\Service\Create\FactoryInterface; use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\State\Service; use NHDS\Jobs\Service\FactoryAbstract; diff --git a/src/Type/Service/Create/Factory.php b/src/Type/Service/Create/Factory.php index 75290531..f46f319f 100644 --- a/src/Type/Service/Create/Factory.php +++ b/src/Type/Service/Create/Factory.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Type\Service\Create; -use NHDS\Jobs\Api\Type\Service\Create\FactoryInterface; +use NHDS\Jobs\Api\V1\Type\Service\Create\FactoryInterface; use NHDS\Jobs\Service\FactoryAbstract; use NHDS\Jobs\Type\Service\Create; use NHDS\Jobs\Type\Service\CreateInterface; diff --git a/src/Worker/Bootstrap.php b/src/Worker/Bootstrap.php index 1b7085af..bedd911e 100644 --- a/src/Worker/Bootstrap.php +++ b/src/Worker/Bootstrap.php @@ -7,8 +7,6 @@ class Bootstrap extends BootstrapAbstract { public function instantiate(): BootstrapInterface { - throw new \LogicException('Client application must define a Bootstrap class.'); - return $this; } } \ No newline at end of file diff --git a/src/Worker/Job/Service.php b/src/Worker/Job/Service.php index e8cbc258..a14d5c43 100644 --- a/src/Worker/Job/Service.php +++ b/src/Worker/Job/Service.php @@ -6,7 +6,7 @@ use NHDS\Jobs\Data\Job; use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\Service\Update; -use NHDS\Jobs\Api\Service\Create; +use NHDS\Jobs\Api; use NHDS\Toolkit\Data\Property\Strict; class Service implements ServiceInterface @@ -16,7 +16,7 @@ class Service implements ServiceInterface use Update\Retry\Factory\AwareTrait; use Update\Complete\Success\Factory\AwareTrait; use Update\Complete\Failed\Factory\AwareTrait; - use Create\Factory\AwareTrait; + use Api\V1\Service\Create\Factory\AwareTrait; use Strict\AwareTrait; const PROP_REQUEST = 'request'; const PROP_RETRY_DATE_TIME = 'retry_date_time'; diff --git a/src/Worker/Job/ServiceInterface.php b/src/Worker/Job/ServiceInterface.php index 4c1e7e5a..d286c15f 100644 --- a/src/Worker/Job/ServiceInterface.php +++ b/src/Worker/Job/ServiceInterface.php @@ -3,7 +3,7 @@ namespace NHDS\Jobs\Worker\Job; -use NHDS\Jobs\Api\Service\Create\FactoryInterface; +use NHDS\Jobs\Api\V1\Service\Create\FactoryInterface; use NHDS\Jobs\Service\CreateInterface; use NHDS\Jobs\Service\Update\Hold; use NHDS\Jobs\Service\Update\Retry; diff --git a/src/config/CacheItemPool/Factory.yml b/src/config/CacheItemPool/Factory.yml new file mode 100644 index 00000000..72a0ccae --- /dev/null +++ b/src/config/CacheItemPool/Factory.yml @@ -0,0 +1,10 @@ +services: + nhds.jobs.cache_item_pool.factory: + class: NHDS\Jobs\CacheItemPool\Factory + public: false + shared: true + calls: + - [setRedisRepository, ['@redis.repository']] + cache_item_pool.factory: + alias: nhds.jobs.cache_item_pool.factory + public: false \ No newline at end of file diff --git a/src/config/CacheItemPool/Repository.yml b/src/config/CacheItemPool/Repository.yml new file mode 100644 index 00000000..ba3d24bf --- /dev/null +++ b/src/config/CacheItemPool/Repository.yml @@ -0,0 +1,11 @@ +services: + nhds.jobs.cache_item_pool.repository: + class: NHDS\Jobs\CacheItemPool\Repository + shared: true + public: false + calls: + - [setCacheItemPoolFactory, ['@cache_item_pool.factory']] + - [setProcessRegistry, ['@process.registry']] + cache_item_pool.repository: + alias: nhds.jobs.cache_item_pool.repository + public: false \ No newline at end of file diff --git a/src/config/Foreman.yml b/src/config/Foreman.yml index c687b03a..1c71c026 100644 --- a/src/config/Foreman.yml +++ b/src/config/Foreman.yml @@ -2,6 +2,7 @@ services: nhds.jobs.foreman: class: NHDS\Jobs\Foreman shared: false + public: false calls: - [setTypeRepository, ['@type.repository']] - [setSelector, ['@selector']] @@ -17,4 +18,5 @@ services: - [setStateService, ['@state.service']] - [setMessageBroker, ['@message.broker.redis']] foreman: - alias: nhds.jobs.foreman \ No newline at end of file + alias: nhds.jobs.foreman + public: false \ No newline at end of file diff --git a/src/config/Maintainer.yml b/src/config/Maintainer.yml index aaeb8071..4fd4e6c9 100644 --- a/src/config/Maintainer.yml +++ b/src/config/Maintainer.yml @@ -2,6 +2,7 @@ services: nhds.jobs.maintainer: class: NHDS\Jobs\Maintainer shared: false + public: false calls: - [setSemaphore, ['@semaphore']] - [addSemaphoreResourceFactory, ['@semaphore.resource.factory-job']] @@ -18,4 +19,5 @@ services: - [setLogger, ['@process.pool.logger']] - [setMaintainerDelete, ['@maintainer.delete']] maintainer: - alias: nhds.jobs.maintainer \ No newline at end of file + alias: nhds.jobs.maintainer + public: false \ No newline at end of file diff --git a/src/config/Message/Broker/Redis.yml b/src/config/Message/Broker/Redis.yml index 0cd731a7..baf6c82c 100644 --- a/src/config/Message/Broker/Redis.yml +++ b/src/config/Message/Broker/Redis.yml @@ -4,10 +4,9 @@ services: shared: false calls: - [setLogger, ['@process.pool.logger']] - - [setPort, ['6379']] - - [setHost, ['redis']] - [setSubscriptionChannelName, ['job_listener_subscribe']] - [setPublishChannelName, ['job_listener_publish']] + - [setRedisRepository, ['@redis.repository']] message.broker.redis: alias: nhds.jobs.message.broker.redis nhds.jobs.message.broker.redis[process.listener.mutex.redis]: @@ -15,7 +14,6 @@ services: shared: false calls: - [setLogger, ['@process.pool.logger']] - - [setPort, ['6379']] - - [setHost, ['redis']] + - [setRedisRepository, ['@redis.repository']] message.broker.redis[process.listener.mutex.redis]: alias: nhds.jobs.message.broker.redis[process.listener.mutex.redis] \ No newline at end of file diff --git a/src/config/Redis.yml b/src/config/Redis.yml new file mode 100644 index 00000000..c8268cbe --- /dev/null +++ b/src/config/Redis.yml @@ -0,0 +1,3 @@ +parameters: + env(REDIS_HOST): 'redis' + env(REDIS_PORT): 6379 \ No newline at end of file diff --git a/src/config/Redis/Factory.yml b/src/config/Redis/Factory.yml index 43fffa92..30467e5c 100644 --- a/src/config/Redis/Factory.yml +++ b/src/config/Redis/Factory.yml @@ -1,6 +1,3 @@ -parameters: - redis.factory.host: 'redis' - redis.factory.port: 6379 services: nhds.jobs.redis.factory: class: NHDS\Jobs\Redis\Factory @@ -8,8 +5,8 @@ services: shared: true calls: - [addOption, [!php/const \Redis::OPT_READ_TIMEOUT, '-1']] - - [setHost, ['%redis.factory.host%']] - - [setPort, ['%redis.factory.port%']] + - [setHost, ['%env(REDIS_HOST)%']] + - [setPort, ['%env(REDIS_PORT)%']] redis.factory: alias: nhds.jobs.redis.factory public: false \ No newline at end of file diff --git a/src/config/Redis/Repository.yml b/src/config/Redis/Repository.yml new file mode 100644 index 00000000..3a35a3e7 --- /dev/null +++ b/src/config/Redis/Repository.yml @@ -0,0 +1,11 @@ +services: + nhds.jobs.redis.repository: + class: NHDS\Jobs\Redis\Repository + public: false + shared: true + calls: + - [setProcessRegistry, ['@process.registry']] + - [setRedisFactory, ['@redis.factory']] + redis.repository: + alias: nhds.jobs.redis.repository + public: false \ No newline at end of file diff --git a/src/config/Scheduler.yml b/src/config/Scheduler.yml index df28a32e..fdb6cd93 100644 --- a/src/config/Scheduler.yml +++ b/src/config/Scheduler.yml @@ -2,6 +2,7 @@ services: nhds.jobs.scheduler: class: NHDS\Jobs\Scheduler shared: false + public: false calls: - [setTime, ['@nhds.toolkit.time']] - [setSchedulerJobCollection, ['@data.job.collection.scheduler']] @@ -10,4 +11,5 @@ services: - [addSemaphoreResourceFactory, ['@semaphore.resource.factory-schedule']] - [setSchedulerCache, ['@scheduler.cache']] scheduler: - alias: nhds.jobs.scheduler \ No newline at end of file + alias: nhds.jobs.scheduler + public: false \ No newline at end of file diff --git a/src/config/Scheduler/Cache.yml b/src/config/Scheduler/Cache.yml index 493dbc1c..c4ce3c83 100644 --- a/src/config/Scheduler/Cache.yml +++ b/src/config/Scheduler/Cache.yml @@ -4,7 +4,7 @@ services: shared: true calls: - [setSchedulerTime, ['@scheduler.time']] - - [setCacheItemPool, ['@symfony.component.cache.adpater.redisadapter']] + - [setCacheItemPoolRepository, ['@cache_item_pool.repository']] - [setTime, ['@nhds.toolkit.time']] scheduler.cache: alias: nhds.jobs.scheduler.cache \ No newline at end of file diff --git a/src/config/Selector.yml b/src/config/Selector.yml index cabc7e62..538a1b9e 100644 --- a/src/config/Selector.yml +++ b/src/config/Selector.yml @@ -1,6 +1,7 @@ services: nhds.jobs.selector: class: NHDS\Jobs\Selector + public: false shared: true calls: - [setPageSize, [50]] @@ -13,4 +14,5 @@ services: - [setStateService, ['@state.service']] - [setRandomIntMax, [10]] selector: - alias: nhds.jobs.selector \ No newline at end of file + alias: nhds.jobs.selector + public: false \ No newline at end of file diff --git a/src/config/Semaphore.yml b/src/config/Semaphore.yml index 55fb1967..3aaedfe9 100644 --- a/src/config/Semaphore.yml +++ b/src/config/Semaphore.yml @@ -1,5 +1,8 @@ services: nhds.jobs.semaphore: class: NHDS\Jobs\Semaphore + public: false + shared: true semaphore: - alias: nhds.jobs.semaphore \ No newline at end of file + alias: nhds.jobs.semaphore + public: false \ No newline at end of file diff --git a/src/config/Semaphore/Mutex/Redis.yml b/src/config/Semaphore/Mutex/Redis.yml index 46491b5a..f3fb60d5 100644 --- a/src/config/Semaphore/Mutex/Redis.yml +++ b/src/config/Semaphore/Mutex/Redis.yml @@ -5,7 +5,7 @@ services: public: false calls: - [setLogger, ['@process.pool.logger']] - - [setRedis, ['@redis']] + - [setRedisRepository, ['@redis.repository']] - [setProcessRegistry, ['@process.registry']] semaphore.mutex.redis: alias: nhds.jobs.semaphore.mutex.redis diff --git a/src/config/dependencies.yml b/src/config/dependencies.yml index 2b6572ce..614ed5c9 100644 --- a/src/config/dependencies.yml +++ b/src/config/dependencies.yml @@ -1,17 +1,8 @@ services: nhds.toolkit.time: class: NHDS\Toolkit\Time - symfony.component.cache.adpater.redisadapter: - class: Symfony\Component\Cache\Adapter\RedisAdapter - arguments: ['@redis'] symfony.component.expressionlanguage.expressionlanguage: class: \Symfony\Component\ExpressionLanguage\ExpressionLanguage - redis: - class: \Redis -# shared: false; -# lazy: true - calls: - - [connect, ['redis', '6379']] nhds.jobs.symfony.component.console.application: public: true class: Symfony\Component\Console\Application diff --git a/src/config/root.yml b/src/config/root.yml index 470767f4..c42dae7f 100644 --- a/src/config/root.yml +++ b/src/config/root.yml @@ -6,6 +6,11 @@ services: imports: # External dependencies. - { resource: dependencies.yml } + - { resource: CacheItemPool/Factory.yml } + - { resource: CacheItemPool/Repository.yml } + - { resource: Redis/Factory.yml } + - { resource: Redis/Repository.yml } + - { resource: Redis.yml } # Manager. - { resource: Foreman.yml } From 4e120becd69761e066738717dacb684cf2c1c822 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 28 Mar 2018 15:58:57 -0500 Subject: [PATCH 06/44] =?UTF-8?q?Neighborhoods=20K=C5=8Dj=C5=8D=20-=20@aal?= =?UTF-8?q?lon=20<3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 +- bin/kojo | 47 ++ composer.json | 15 +- composer.lock | 86 +- .../CacheItemPool/Factory.yml | 6 +- .../CacheItemPool/Repository.yml | 6 +- config/Console/Command/Db/Setup/Install.yml | 8 + .../Console/Command/Db/TearDown/Uninstall.yml | 8 + .../Command/Process/Pool/Server/Start.yml | 5 + {src/config => config}/Data/Job.yml | 6 +- .../Data/Job/Collection/CrashDetection.yml | 6 +- .../Data/Job/Collection/Delete.yml | 6 +- config/Data/Job/Collection/Iterator.yml | 6 + .../Job/Collection/Schedule/LimitCheck.yml | 6 +- .../Data/Job/Collection/ScheduleLimit.yml | 6 +- .../Data/Job/Collection/Scheduler.yml | 6 +- .../Data/Job/Collection/Selector.yml | 6 +- {src/config => config}/Data/Job/Type.yml | 6 +- config/Data/Job/Type/Collection/Iterator.yml | 6 + .../Data/Job/Type/Collection/Scheduler.yml | 6 +- config/Db/Connection/Container.yml | 13 + {src/config => config}/Db/Setup.yml | 6 +- config/Db/Setup/Schema/Version_0_0_0.yml | 7 + config/Db/Setup/Schema/Version_1_0_0.yml | 7 + config/Db/Setup/Schema/Version_2_0_0.yml | 7 + config/Db/Setup/Schema/Version_3_0_0.yml | 7 + config/Db/Setup/Schema/Version_4_0_0.yml | 7 + config/Db/Setup/Schema/Version_5_0_0.yml | 7 + config/Db/Setup/Schema/Version_6_0_0.yml | 7 + {src/config => config}/Db/TearDown.yml | 6 +- config/Db/TearDown/Schema/Version_0_0_0.yml | 7 + config/Db/TearDown/Schema/Version_1_0_0.yml | 7 + config/Db/TearDown/Schema/Version_2_0_0.yml | 7 + config/Db/TearDown/Schema/Version_3_0_0.yml | 7 + config/Db/TearDown/Schema/Version_4_0_0.yml | 7 + config/Db/TearDown/Schema/Version_5_0_0.yml | 7 + config/Db/TearDown/Schema/Version_6_0_0.yml | 7 + {src/config => config}/Foreman.yml | 6 +- {src/config => config}/Maintainer.yml | 6 +- {src/config => config}/Maintainer/Delete.yml | 6 +- .../Message/Broker/Redis.yml | 12 +- .../Message/Broker/Type/Collection.yml | 6 +- config/Process.yml | 2 + {src/config => config}/Process/Collection.yml | 24 +- config/Process/Collection/Iterator.yml | 6 + {src/config => config}/Process/Job.yml | 6 +- .../Process/Job/Required.yml | 6 +- .../Process/Listener/Command.yml | 8 +- .../Process/Listener/Mutex/Redis.yml | 8 +- {src/config => config}/Process/Pool.yml | 6 +- .../Process/Pool/Factory.yml | 24 +- .../config => config}/Process/Pool/Logger.yml | 6 +- .../config => config}/Process/Pool/Server.yml | 6 +- .../Process/Pool/Strategy.yml | 18 +- config/Process/Registry.yml | 8 + {src/config => config}/Process/Root.yml | 6 +- config/Process/Signal.yml | 8 + config/Process/Strategy/ProcessControl.yml | 5 + {src/config => config}/Redis.yml | 0 {src/config => config}/Redis/Factory.yml | 6 +- {src/config => config}/Redis/Repository.yml | 6 +- {src/config => config}/Scheduler.yml | 6 +- {src/config => config}/Scheduler/Cache.yml | 6 +- {src/config => config}/Scheduler/Time.yml | 6 +- {src/config => config}/Selector.yml | 6 +- config/Semaphore.yml | 8 + .../Semaphore/Mutex/Flock.yml | 6 +- .../Semaphore/Mutex/Redis.yml | 6 +- config/Semaphore/Resource.yml | 53 ++ .../Semaphore/Resource/Factory.yml | 36 +- config/Semaphore/Resource/Owner/Job.yml | 5 + {src/config => config}/Service/Create.yml | 6 +- .../Service/Create/Factory.yml | 6 +- config/Service/Update/Complete/Failed.yml | 6 + .../Update/Complete/Failed/Factory.yml | 8 + .../Complete/FailedScheduleLimitCheck.yml | 6 + .../FailedScheduleLimitCheck/Factory.yml | 8 + config/Service/Update/Complete/Success.yml | 6 + .../Update/Complete/Success/Factory.yml | 8 + config/Service/Update/Crash.yml | 6 + config/Service/Update/Crash/Factory.yml | 8 + config/Service/Update/Hold.yml | 6 + config/Service/Update/Hold/Factory.yml | 8 + config/Service/Update/Panic.yml | 6 + config/Service/Update/Panic/Factory.yml | 8 + config/Service/Update/Retry.yml | 6 + config/Service/Update/Retry/Factory.yml | 8 + config/Service/Update/Wait.yml | 6 + config/Service/Update/Wait/Factory.yml | 8 + config/Service/Update/Work.yml | 6 + config/Service/Update/Work/Factory.yml | 8 + {src/config => config}/State/Service.yml | 6 +- config/Type/Repository.yml | 7 + config/Type/Service/Create.yml | 7 + config/Worker/Bootstrap.yml | 5 + {src/config => config}/Worker/Job/Service.yml | 6 +- config/Worker/Locator.yml | 6 + {src/config => config}/dependencies.yml | 4 +- {src/config => config}/root.yml | 0 example/Worker.php | 2 +- example/Worker/Bootstrap.php | 10 +- example/config/root.yml | 22 +- .../ContainerBuilder/AwareTrait.php | 2 +- .../Data/Property/Persistent/AwareTrait.php | 2 +- .../Data/Property/Strict/AwareTrait.php | 2 +- nhdstoolkitsrc/Time.php | 2 +- nhdstoolkitsrc/Time/AwareTrait.php | 4 +- nhdstoolkitsrc/TimeInterface.php | 2 +- nhdswatchsrc/AbstractTest.php | 2 +- nhdswatchsrc/Fixture/AbstractTest.php | 4 +- .../DbUnit/DataSet/SymfonyYamlParser.php | 2 +- .../TestCase/ContainerBuilder/AwareTrait.php | 2 +- nhdswatchsrc/TestCase/Service.php | 2 +- nhdswatchsrc/config/root.yml | 2 +- .../V1/Service/Create/Factory/AwareTrait.php | 4 +- .../V1/Service/Create/FactoryInterface.php | 10 +- .../Service/Create/Factory/AwareTrait.php | 4 +- .../Type/Service/Create/FactoryInterface.php | 6 +- src/Api/V1/Worker/Job/Service/AwareTrait.php | 4 +- src/Api/V1/Worker/Job/ServiceInterface.php | 4 +- src/AutoSchedule/Sqs/Worker.php | 4 +- src/AutoSchedule/Sqs/WorkerInterface.php | 2 +- src/CacheItemPool/Factory.php | 6 +- src/CacheItemPool/Factory/AwareTrait.php | 4 +- src/CacheItemPool/FactoryInterface.php | 6 +- src/CacheItemPool/Repository.php | 8 +- src/CacheItemPool/Repository/AwareTrait.php | 4 +- src/CacheItemPool/RepositoryInterface.php | 2 +- src/Console/Command/Db/Setup/Install.php | 13 +- src/Console/Command/Db/TearDown/Uninstall.php | 8 +- .../Command/Process/Pool/Server/Start.php | 10 +- src/Console/CommandAbstract.php | 9 +- src/Data/AutoSchedule/Sqs.php | 6 +- src/Data/AutoSchedule/Sqs/AwareTrait.php | 4 +- src/Data/AutoSchedule/SqsInterface.php | 8 +- src/Data/Job.php | 8 +- src/Data/Job/AwareTrait.php | 4 +- src/Data/Job/Collection/CrashDetection.php | 10 +- .../Collection/CrashDetection/AwareTrait.php | 4 +- .../Collection/CrashDetectionInterface.php | 4 +- src/Data/Job/Collection/Delete.php | 10 +- src/Data/Job/Collection/Delete/AwareTrait.php | 4 +- src/Data/Job/Collection/DeleteInterface.php | 4 +- src/Data/Job/Collection/Iterator.php | 8 +- src/Data/Job/Collection/IteratorInterface.php | 6 +- .../Job/Collection/Schedule/LimitCheck.php | 10 +- .../Schedule/LimitCheck/AwareTrait.php | 4 +- .../Schedule/LimitCheckInterface.php | 4 +- src/Data/Job/Collection/ScheduleLimit.php | 16 +- .../Collection/ScheduleLimit/AwareTrait.php | 6 +- .../Job/Collection/ScheduleLimitInterface.php | 6 +- src/Data/Job/Collection/Scheduler.php | 10 +- .../Job/Collection/Scheduler/AwareTrait.php | 4 +- .../Job/Collection/SchedulerInterface.php | 4 +- src/Data/Job/Collection/Selector.php | 12 +- .../Job/Collection/Selector/AwareTrait.php | 4 +- src/Data/Job/Collection/SelectorInterface.php | 4 +- src/Data/Job/CollectionAbstract.php | 8 +- src/Data/Job/CollectionInterface.php | 6 +- src/Data/Job/Type.php | 4 +- src/Data/Job/Type/AwareTrait.php | 4 +- src/Data/Job/Type/Collection/Iterator.php | 8 +- .../Job/Type/Collection/IteratorInterface.php | 6 +- src/Data/Job/Type/Collection/Scheduler.php | 8 +- .../Type/Collection/Scheduler/AwareTrait.php | 4 +- .../Type/Collection/SchedulerInterface.php | 4 +- src/Data/Job/Type/CollectionAbstract.php | 6 +- src/Data/Job/Type/CollectionInterface.php | 6 +- src/Data/Job/TypeInterface.php | 8 +- src/Data/JobInterface.php | 8 +- src/Data/Status.php | 8 +- src/Data/Status/AwareTrait.php | 4 +- src/Data/Status/Message.php | 8 +- src/Data/Status/Type.php | 6 +- src/Data/StatusInterface.php | 4 +- src/Db/Connection/Container.php | 2 +- src/Db/Connection/Container/AwareTrait.php | 4 +- src/Db/Connection/ContainerInterface.php | 2 +- src/Db/Model.php | 10 +- src/Db/Model/AwareTrait.php | 4 +- src/Db/Model/Collection/AwareTrait.php | 4 +- src/Db/Model/CollectionAbstract.php | 10 +- src/Db/Model/CollectionInterface.php | 4 +- src/Db/ModelInterface.php | 4 +- src/Db/Schema/Version/AwareTrait.php | 4 +- src/Db/Schema/VersionAbstract.php | 6 +- src/Db/Schema/VersionInterface.php | 2 +- src/Db/Setup.php | 6 +- src/Db/Setup/AwareTrait.php | 4 +- src/Db/Setup/Schema/Version_0_0_0.php | 10 +- src/Db/Setup/Schema/Version_1_0_0.php | 8 +- src/Db/Setup/Schema/Version_2_0_0.php | 10 +- src/Db/Setup/Schema/Version_3_0_0.php | 10 +- src/Db/Setup/Schema/Version_4_0_0.php | 8 +- src/Db/Setup/Schema/Version_5_0_0.php | 10 +- src/Db/Setup/Schema/Version_6_0_0.php | 8 +- src/Db/SetupInterface.php | 4 +- src/Db/TearDown.php | 6 +- src/Db/TearDown/AwareTrait.php | 4 +- src/Db/TearDown/Schema/Version_0_0_0.php | 8 +- src/Db/TearDown/Schema/Version_1_0_0.php | 8 +- src/Db/TearDown/Schema/Version_2_0_0.php | 8 +- src/Db/TearDown/Schema/Version_3_0_0.php | 8 +- src/Db/TearDown/Schema/Version_4_0_0.php | 8 +- src/Db/TearDown/Schema/Version_5_0_0.php | 8 +- src/Db/TearDown/Schema/Version_6_0_0.php | 8 +- src/Db/TearDownInterface.php | 2 +- src/Exception/ExceptionTrait.php | 2 +- .../Runtime/Db/Model/LoadException.php | 4 +- src/Exception/Runtime/Exception.php | 4 +- src/Exception/Runtime/Filesystem.php | 2 +- .../Runtime/Filesystem/AwareTrait.php | 4 +- src/Filesystem/AwareTrait.php | 2 +- src/Foreman.php | 18 +- src/Foreman/AwareTrait.php | 4 +- src/ForemanInterface.php | 6 +- src/Maintainer.php | 16 +- src/Maintainer/AwareTrait.php | 4 +- src/Maintainer/Delete.php | 10 +- src/Maintainer/Delete/AwareTrait.php | 4 +- src/Maintainer/DeleteInterface.php | 2 +- src/MaintainerInterface.php | 4 +- src/Message/Broker/AwareTrait.php | 2 +- src/Message/Broker/BrokerAbstract.php | 6 +- src/Message/Broker/BrokerInterface.php | 2 +- src/Message/Broker/Redis.php | 6 +- src/Message/Broker/Type/Collection.php | 6 +- .../Broker/Type/Collection/AwareTrait.php | 6 +- .../Type/Collection/CollectionInterface.php | 2 +- src/Process/AwareTrait.php | 4 +- src/Process/Collection.php | 8 +- src/Process/Collection/AwareTrait.php | 4 +- src/Process/Collection/Iterator.php | 8 +- src/Process/Collection/IteratorInterface.php | 6 +- src/Process/CollectionInterface.php | 6 +- src/Process/Forked.php | 8 +- src/Process/Job.php | 14 +- src/Process/Job/Required.php | 6 +- src/Process/JobInterface.php | 4 +- src/Process/Listener/Command.php | 8 +- src/Process/Listener/CommandInterface.php | 4 +- src/Process/Listener/Mutex/Redis.php | 12 +- src/Process/Listener/Mutex/RedisInterface.php | 4 +- src/Process/ListenerAbstract.php | 4 +- src/Process/ListenerInterface.php | 4 +- src/Process/Pool.php | 4 +- src/Process/Pool/AwareTrait.php | 4 +- src/Process/Pool/Factory.php | 6 +- src/Process/Pool/Factory/AwareTrait.php | 4 +- src/Process/Pool/FactoryInterface.php | 8 +- src/Process/Pool/Logger.php | 8 +- src/Process/Pool/Logger/AwareTrait.php | 4 +- src/Process/Pool/LoggerInterface.php | 4 +- src/Process/Pool/Server.php | 12 +- src/Process/Pool/ServerInterface.php | 4 +- src/Process/Pool/Strategy.php | 8 +- src/Process/Pool/Strategy/AwareTrait.php | 4 +- src/Process/Pool/StrategyAbstract.php | 6 +- src/Process/Pool/StrategyInterface.php | 8 +- src/Process/PoolAbstract.php | 8 +- src/Process/PoolInterface.php | 6 +- src/Process/Registry.php | 4 +- src/Process/Registry/AwareTrait.php | 4 +- src/Process/RegistryInterface.php | 4 +- src/Process/Root.php | 4 +- src/Process/Signal.php | 2 +- src/Process/Signal/AwareTrait.php | 4 +- src/Process/SignalInterface.php | 2 +- src/Process/Strategy/AwareTrait.php | 4 +- src/Process/Strategy/ProcessControl.php | 4 +- src/Process/StrategyInterface.php | 2 +- src/ProcessAbstract.php | 8 +- src/ProcessInterface.php | 6 +- src/Redis/Factory.php | 6 +- src/Redis/Factory/AwareTrait.php | 4 +- src/Redis/FactoryInterface.php | 4 +- src/Redis/Repository.php | 8 +- src/Redis/Repository/AwareTrait.php | 4 +- src/Redis/RepositoryInterface.php | 4 +- src/RepositoryInterface.php | 2 +- src/Scheduler.php | 10 +- src/Scheduler/AwareTrait.php | 4 +- src/Scheduler/Cache.php | 10 +- src/Scheduler/Cache/AwareTrait.php | 4 +- src/Scheduler/CacheInterface.php | 4 +- src/Scheduler/Time.php | 6 +- src/Scheduler/Time/AwareTrait.php | 4 +- src/Scheduler/TimeInterface.php | 2 +- src/SchedulerInterface.php | 4 +- src/Selector.php | 16 +- src/Selector/AwareTrait.php | 4 +- src/SelectorInterface.php | 4 +- src/Semaphore.php | 4 +- src/Semaphore/AwareTrait.php | 4 +- src/Semaphore/Mutex/AwareTrait.php | 4 +- src/Semaphore/Mutex/Flock.php | 16 +- src/Semaphore/Mutex/Redis.php | 16 +- src/Semaphore/Mutex/RedisInterface.php | 4 +- src/Semaphore/MutexAbstract.php | 4 +- src/Semaphore/MutexInterface.php | 2 +- src/Semaphore/Resource.php | 8 +- src/Semaphore/Resource/AwareTrait.php | 4 +- src/Semaphore/Resource/Factory.php | 8 +- src/Semaphore/Resource/Factory/AwareTrait.php | 10 +- src/Semaphore/Resource/FactoryInterface.php | 8 +- src/Semaphore/Resource/Owner/AwareTrait.php | 4 +- src/Semaphore/Resource/Owner/Job.php | 6 +- src/Semaphore/Resource/Owner/JobInterface.php | 6 +- src/Semaphore/Resource/OwnerInterface.php | 2 +- src/Semaphore/ResourceInterface.php | 6 +- src/SemaphoreInterface.php | 4 +- src/Service/Container.php | 4 +- src/Service/Create.php | 12 +- src/Service/Create/AwareTrait.php | 4 +- src/Service/Create/Factory.php | 14 +- src/Service/CreateInterface.php | 8 +- src/Service/FactoryAbstract.php | 4 +- src/Service/FactoryInterface.php | 2 +- src/Service/Update/Complete/Failed.php | 4 +- .../Update/Complete/Failed/AwareTrait.php | 4 +- .../Update/Complete/Failed/Factory.php | 10 +- .../Complete/Failed/Factory/AwareTrait.php | 4 +- .../Complete/Failed/FactoryInterface.php | 8 +- .../Update/Complete/FailedInterface.php | 4 +- .../Complete/FailedScheduleLimitCheck.php | 4 +- .../FailedScheduleLimitCheck/AwareTrait.php | 6 +- .../FailedScheduleLimitCheck/Factory.php | 10 +- .../Factory/AwareTrait.php | 4 +- .../FactoryInterface.php | 8 +- .../FailedScheduleLimitCheckInterface.php | 4 +- src/Service/Update/Complete/Success.php | 4 +- .../Update/Complete/Success/AwareTrait.php | 4 +- .../Update/Complete/Success/Factory.php | 10 +- .../Complete/Success/Factory/AwareTrait.php | 4 +- .../Complete/Success/FactoryInterface.php | 8 +- .../Update/Complete/SuccessInterface.php | 4 +- src/Service/Update/Crash.php | 4 +- src/Service/Update/Crash/AwareTrait.php | 4 +- src/Service/Update/Crash/Factory.php | 10 +- .../Update/Crash/Factory/AwareTrait.php | 4 +- src/Service/Update/Crash/FactoryInterface.php | 8 +- src/Service/Update/CrashInterface.php | 4 +- src/Service/Update/Hold.php | 4 +- src/Service/Update/Hold/AwareTrait.php | 4 +- src/Service/Update/Hold/Factory.php | 10 +- .../Update/Hold/Factory/AwareTrait.php | 4 +- src/Service/Update/Hold/FactoryInterface.php | 8 +- src/Service/Update/HoldInterface.php | 4 +- src/Service/Update/Panic.php | 4 +- src/Service/Update/Panic/AwareTrait.php | 4 +- src/Service/Update/Panic/Factory.php | 10 +- .../Update/Panic/Factory/AwareTrait.php | 4 +- src/Service/Update/Panic/FactoryInterface.php | 8 +- src/Service/Update/PanicInterface.php | 4 +- src/Service/Update/Retry.php | 4 +- src/Service/Update/Retry/AwareTrait.php | 4 +- src/Service/Update/Retry/Factory.php | 10 +- .../Update/Retry/Factory/AwareTrait.php | 4 +- src/Service/Update/Retry/FactoryInterface.php | 8 +- src/Service/Update/RetryInterface.php | 4 +- src/Service/Update/Wait.php | 4 +- src/Service/Update/Wait/AwareTrait.php | 4 +- src/Service/Update/Wait/Factory.php | 10 +- .../Update/Wait/Factory/AwareTrait.php | 4 +- src/Service/Update/Wait/FactoryInterface.php | 8 +- src/Service/Update/WaitInterface.php | 4 +- src/Service/Update/Work.php | 4 +- src/Service/Update/Work/AwareTrait.php | 4 +- src/Service/Update/Work/Factory.php | 10 +- .../Update/Work/Factory/AwareTrait.php | 4 +- src/Service/Update/Work/FactoryInterface.php | 8 +- src/Service/Update/WorkInterface.php | 4 +- src/ServiceAbstract.php | 6 +- src/ServiceInterface.php | 4 +- src/State/Service.php | 10 +- src/State/Service/AwareTrait.php | 4 +- src/State/ServiceInterface.php | 4 +- src/Status/Service.php | 4 +- src/Status/ServiceInterface.php | 4 +- src/Status/State/Service.php | 2 +- src/Status/State/ServiceInterface.php | 2 +- src/Type/Repository.php | 8 +- src/Type/Repository/AwareTrait.php | 4 +- src/Type/RepositoryInterface.php | 4 +- src/Type/Service.php | 2 +- src/Type/Service/Create.php | 4 +- src/Type/Service/Create/AwareTrait.php | 4 +- src/Type/Service/Create/Factory.php | 10 +- src/Type/Service/CreateInterface.php | 4 +- src/Type/ServiceAbstract.php | 8 +- src/Type/ServiceInterface.php | 4 +- src/Worker/Bootstrap.php | 2 +- src/Worker/Bootstrap/AwareTrait.php | 4 +- src/Worker/BootstrapAbstract.php | 8 +- src/Worker/BootstrapInterface.php | 4 +- src/Worker/Job/Service.php | 12 +- src/Worker/Job/Service/AwareTrait.php | 4 +- src/Worker/Job/ServiceInterface.php | 16 +- src/Worker/Locator.php | 6 +- src/Worker/Locator/AwareTrait.php | 4 +- src/Worker/LocatorInterface.php | 4 +- src/bin/jobs | 33 - src/bin/server | 36 - .../Console/Command/Db/Setup/Install.yml | 8 - .../Console/Command/Db/TearDown/Uninstall.yml | 8 - .../Command/Process/Pool/Server/Start.yml | 5 - src/config/Data/Job/Collection/Iterator.yml | 6 - .../Data/Job/Type/Collection/Iterator.yml | 6 - src/config/Db/Connection/Container.yml | 13 - src/config/Db/Setup/Schema/Version_0_0_0.yml | 7 - src/config/Db/Setup/Schema/Version_1_0_0.yml | 7 - src/config/Db/Setup/Schema/Version_2_0_0.yml | 7 - src/config/Db/Setup/Schema/Version_3_0_0.yml | 7 - src/config/Db/Setup/Schema/Version_4_0_0.yml | 7 - src/config/Db/Setup/Schema/Version_5_0_0.yml | 7 - src/config/Db/Setup/Schema/Version_6_0_0.yml | 7 - .../Db/TearDown/Schema/Version_0_0_0.yml | 7 - .../Db/TearDown/Schema/Version_1_0_0.yml | 7 - .../Db/TearDown/Schema/Version_2_0_0.yml | 7 - .../Db/TearDown/Schema/Version_3_0_0.yml | 7 - .../Db/TearDown/Schema/Version_4_0_0.yml | 7 - .../Db/TearDown/Schema/Version_5_0_0.yml | 7 - .../Db/TearDown/Schema/Version_6_0_0.yml | 7 - src/config/Process.yml | 2 - src/config/Process/Collection/Iterator.yml | 6 - src/config/Process/Registry.yml | 8 - src/config/Process/Signal.yml | 8 - .../Process/Strategy/ProcessControl.yml | 5 - src/config/Semaphore.yml | 8 - src/config/Semaphore/Resource.yml | 53 -- src/config/Semaphore/Resource/Owner/Job.yml | 5 - src/config/Service/Update/Complete/Failed.yml | 6 - .../Update/Complete/Failed/Factory.yml | 8 - .../Complete/FailedScheduleLimitCheck.yml | 6 - .../FailedScheduleLimitCheck/Factory.yml | 8 - .../Service/Update/Complete/Success.yml | 6 - .../Update/Complete/Success/Factory.yml | 8 - src/config/Service/Update/Crash.yml | 6 - src/config/Service/Update/Crash/Factory.yml | 8 - src/config/Service/Update/Hold.yml | 6 - src/config/Service/Update/Hold/Factory.yml | 8 - src/config/Service/Update/Panic.yml | 6 - src/config/Service/Update/Panic/Factory.yml | 8 - src/config/Service/Update/Retry.yml | 6 - src/config/Service/Update/Retry/Factory.yml | 8 - src/config/Service/Update/Wait.yml | 6 - src/config/Service/Update/Wait/Factory.yml | 8 - src/config/Service/Update/Work.yml | 6 - src/config/Service/Update/Work/Factory.yml | 8 - src/config/Type/Repository.yml | 7 - src/config/Type/Service/Create.yml | 7 - src/config/Worker/Bootstrap.yml | 5 - src/config/Worker/Locator.yml | 6 - tests/Process/Strategy/Mock.php | 4 +- tests/Unit/ForemanInterfaceTest.php | 8 +- tests/Unit/MaintainerInterfaceTest.php | 8 +- tests/Unit/Process/PooIInterfaceTest.php | 4 +- .../Unit/Process/Pool/ServerInterfaceTest.php | 4 +- tests/Unit/SchedulerInterfaceTest.php | 4 +- tests/Unit/SelectorInterfaceTest.php | 2 +- tests/Unit/SemaphoreInterfaceTest.php | 10 +- tests/Unit/Service/CreateInterfaceTest.php | 2 +- .../Service/config/CreateInterfaceTest.yml | 16 +- .../CreateInterfaceTest/1_job_types.yml | 6 +- .../fixtures/CreateInterfaceTest/2_jobs.yml | 164 ++-- tests/Unit/config/ForemanInterfaceTest.yml | 8 +- tests/Unit/config/SelectorInterfaceTest.yml | 2 +- .../ForemanInterfaceTest/1_job_types.yml | 10 +- .../fixtures/ForemanInterfaceTest/2_jobs.yml | 798 +++++++++--------- .../MaintainerInterfaceTest/1_job_types.yml | 6 +- .../MaintainerInterfaceTest/2_jobs.yml | 42 +- .../SchedulerInterfaceTest/1_job_types.yml | 10 +- .../SchedulerInterfaceTest/2_jobs.yml | 14 +- .../SelectorInterfaceTest/1_job_types.yml | 10 +- .../fixtures/SelectorInterfaceTest/2_jobs.yml | 798 +++++++++--------- tests/Worker/Mock.php | 2 +- tests/config/Process/Strategy/Mock.yml | 4 +- tests/config/root.yml | 24 +- 478 files changed, 2518 insertions(+), 2558 deletions(-) create mode 100755 bin/kojo rename {src/config => config}/CacheItemPool/Factory.yml (50%) rename {src/config => config}/CacheItemPool/Repository.yml (57%) create mode 100644 config/Console/Command/Db/Setup/Install.yml create mode 100644 config/Console/Command/Db/TearDown/Uninstall.yml create mode 100644 config/Console/Command/Process/Pool/Server/Start.yml rename {src/config => config}/Data/Job.yml (52%) rename {src/config => config}/Data/Job/Collection/CrashDetection.yml (60%) rename {src/config => config}/Data/Job/Collection/Delete.yml (61%) create mode 100644 config/Data/Job/Collection/Iterator.yml rename {src/config => config}/Data/Job/Collection/Schedule/LimitCheck.yml (58%) rename {src/config => config}/Data/Job/Collection/ScheduleLimit.yml (60%) rename {src/config => config}/Data/Job/Collection/Scheduler.yml (61%) rename {src/config => config}/Data/Job/Collection/Selector.yml (62%) rename {src/config => config}/Data/Job/Type.yml (50%) create mode 100644 config/Data/Job/Type/Collection/Iterator.yml rename {src/config => config}/Data/Job/Type/Collection/Scheduler.yml (57%) create mode 100644 config/Db/Connection/Container.yml rename {src/config => config}/Db/Setup.yml (80%) create mode 100644 config/Db/Setup/Schema/Version_0_0_0.yml create mode 100644 config/Db/Setup/Schema/Version_1_0_0.yml create mode 100644 config/Db/Setup/Schema/Version_2_0_0.yml create mode 100644 config/Db/Setup/Schema/Version_3_0_0.yml create mode 100644 config/Db/Setup/Schema/Version_4_0_0.yml create mode 100644 config/Db/Setup/Schema/Version_5_0_0.yml create mode 100644 config/Db/Setup/Schema/Version_6_0_0.yml rename {src/config => config}/Db/TearDown.yml (80%) create mode 100644 config/Db/TearDown/Schema/Version_0_0_0.yml create mode 100644 config/Db/TearDown/Schema/Version_1_0_0.yml create mode 100644 config/Db/TearDown/Schema/Version_2_0_0.yml create mode 100644 config/Db/TearDown/Schema/Version_3_0_0.yml create mode 100644 config/Db/TearDown/Schema/Version_4_0_0.yml create mode 100644 config/Db/TearDown/Schema/Version_5_0_0.yml create mode 100644 config/Db/TearDown/Schema/Version_6_0_0.yml rename {src/config => config}/Foreman.yml (88%) rename {src/config => config}/Maintainer.yml (90%) rename {src/config => config}/Maintainer/Delete.yml (71%) rename {src/config => config}/Message/Broker/Redis.yml (57%) rename {src/config => config}/Message/Broker/Type/Collection.yml (56%) create mode 100644 config/Process.yml rename {src/config => config}/Process/Collection.yml (55%) create mode 100644 config/Process/Collection/Iterator.yml rename {src/config => config}/Process/Job.yml (86%) rename {src/config => config}/Process/Job/Required.yml (83%) rename {src/config => config}/Process/Listener/Command.yml (74%) rename {src/config => config}/Process/Listener/Mutex/Redis.yml (72%) rename {src/config => config}/Process/Pool.yml (55%) rename {src/config => config}/Process/Pool/Factory.yml (80%) rename {src/config => config}/Process/Pool/Logger.yml (75%) rename {src/config => config}/Process/Pool/Server.yml (81%) rename {src/config => config}/Process/Pool/Strategy.yml (65%) create mode 100644 config/Process/Registry.yml rename {src/config => config}/Process/Root.yml (79%) create mode 100644 config/Process/Signal.yml create mode 100644 config/Process/Strategy/ProcessControl.yml rename {src/config => config}/Redis.yml (100%) rename {src/config => config}/Redis/Factory.yml (65%) rename {src/config => config}/Redis/Repository.yml (58%) rename {src/config => config}/Scheduler.yml (80%) rename {src/config => config}/Scheduler/Cache.yml (62%) rename {src/config => config}/Scheduler/Time.yml (52%) rename {src/config => config}/Selector.yml (81%) create mode 100644 config/Semaphore.yml rename {src/config => config}/Semaphore/Mutex/Flock.yml (59%) rename {src/config => config}/Semaphore/Mutex/Redis.yml (62%) create mode 100644 config/Semaphore/Resource.yml rename {src/config => config}/Semaphore/Resource/Factory.yml (57%) create mode 100644 config/Semaphore/Resource/Owner/Job.yml rename {src/config => config}/Service/Create.yml (54%) rename {src/config => config}/Service/Create/Factory.yml (66%) create mode 100644 config/Service/Update/Complete/Failed.yml create mode 100644 config/Service/Update/Complete/Failed/Factory.yml create mode 100644 config/Service/Update/Complete/FailedScheduleLimitCheck.yml create mode 100644 config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml create mode 100644 config/Service/Update/Complete/Success.yml create mode 100644 config/Service/Update/Complete/Success/Factory.yml create mode 100644 config/Service/Update/Crash.yml create mode 100644 config/Service/Update/Crash/Factory.yml create mode 100644 config/Service/Update/Hold.yml create mode 100644 config/Service/Update/Hold/Factory.yml create mode 100644 config/Service/Update/Panic.yml create mode 100644 config/Service/Update/Panic/Factory.yml create mode 100644 config/Service/Update/Retry.yml create mode 100644 config/Service/Update/Retry/Factory.yml create mode 100644 config/Service/Update/Wait.yml create mode 100644 config/Service/Update/Wait/Factory.yml create mode 100644 config/Service/Update/Work.yml create mode 100644 config/Service/Update/Work/Factory.yml rename {src/config => config}/State/Service.yml (54%) create mode 100644 config/Type/Repository.yml create mode 100644 config/Type/Service/Create.yml create mode 100644 config/Worker/Bootstrap.yml rename {src/config => config}/Worker/Job/Service.yml (76%) create mode 100644 config/Worker/Locator.yml rename {src/config => config}/dependencies.yml (82%) rename {src/config => config}/root.yml (100%) delete mode 100755 src/bin/jobs delete mode 100755 src/bin/server delete mode 100644 src/config/Console/Command/Db/Setup/Install.yml delete mode 100644 src/config/Console/Command/Db/TearDown/Uninstall.yml delete mode 100644 src/config/Console/Command/Process/Pool/Server/Start.yml delete mode 100644 src/config/Data/Job/Collection/Iterator.yml delete mode 100644 src/config/Data/Job/Type/Collection/Iterator.yml delete mode 100644 src/config/Db/Connection/Container.yml delete mode 100644 src/config/Db/Setup/Schema/Version_0_0_0.yml delete mode 100644 src/config/Db/Setup/Schema/Version_1_0_0.yml delete mode 100644 src/config/Db/Setup/Schema/Version_2_0_0.yml delete mode 100644 src/config/Db/Setup/Schema/Version_3_0_0.yml delete mode 100644 src/config/Db/Setup/Schema/Version_4_0_0.yml delete mode 100644 src/config/Db/Setup/Schema/Version_5_0_0.yml delete mode 100644 src/config/Db/Setup/Schema/Version_6_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_0_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_1_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_2_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_3_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_4_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_5_0_0.yml delete mode 100644 src/config/Db/TearDown/Schema/Version_6_0_0.yml delete mode 100644 src/config/Process.yml delete mode 100644 src/config/Process/Collection/Iterator.yml delete mode 100644 src/config/Process/Registry.yml delete mode 100644 src/config/Process/Signal.yml delete mode 100644 src/config/Process/Strategy/ProcessControl.yml delete mode 100644 src/config/Semaphore.yml delete mode 100644 src/config/Semaphore/Resource.yml delete mode 100644 src/config/Semaphore/Resource/Owner/Job.yml delete mode 100644 src/config/Service/Update/Complete/Failed.yml delete mode 100644 src/config/Service/Update/Complete/Failed/Factory.yml delete mode 100644 src/config/Service/Update/Complete/FailedScheduleLimitCheck.yml delete mode 100644 src/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml delete mode 100644 src/config/Service/Update/Complete/Success.yml delete mode 100644 src/config/Service/Update/Complete/Success/Factory.yml delete mode 100644 src/config/Service/Update/Crash.yml delete mode 100644 src/config/Service/Update/Crash/Factory.yml delete mode 100644 src/config/Service/Update/Hold.yml delete mode 100644 src/config/Service/Update/Hold/Factory.yml delete mode 100644 src/config/Service/Update/Panic.yml delete mode 100644 src/config/Service/Update/Panic/Factory.yml delete mode 100644 src/config/Service/Update/Retry.yml delete mode 100644 src/config/Service/Update/Retry/Factory.yml delete mode 100644 src/config/Service/Update/Wait.yml delete mode 100644 src/config/Service/Update/Wait/Factory.yml delete mode 100644 src/config/Service/Update/Work.yml delete mode 100644 src/config/Service/Update/Work/Factory.yml delete mode 100644 src/config/Type/Repository.yml delete mode 100644 src/config/Type/Service/Create.yml delete mode 100644 src/config/Worker/Bootstrap.yml delete mode 100644 src/config/Worker/Locator.yml diff --git a/README.md b/README.md index 282afebb..2bcfaabf 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,2 @@ -# nhds/jobs -A distributed job system. - -Example usage: -```php -getContainerBuilder()->get('server'); - -$server->start(); -``` - -**OR** - -Anything that is good is from sitting on the shoulder of one giant or another. Anything that is bad is mine, the only comfort I have to offer is the following from yet another giant: - -* https://xkcd.com/1513/ -* https://xkcd.com/1695/ -* https://xkcd.com/1833/ \ No newline at end of file +# Neighborhoods Kōjō +A distributed task manager. \ No newline at end of file diff --git a/bin/kojo b/bin/kojo new file mode 100755 index 00000000..d8e0ed0b --- /dev/null +++ b/bin/kojo @@ -0,0 +1,47 @@ +#!/usr/bin/env php +getMessage(); + exit(1); +} +$serviceContainer = new Container(); +$ymlServiceFilePath = __DIR__ . '/../config/root.yml'; +$serviceContainer->addServicesYmlFilePath($ymlServiceFilePath); +if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { + $serviceContainer->addServicesYmlFilePath($argv[2]); +}elseif (isset($argv[1]) && is_string($argv[1]) && $argv[1] === Start::OPT_RUN_SERVER) { + foreach ($argv as $argument) { + if (strstr($argument, 'ysfp:') !== false) { + $ymlServicesFilePath = explode('ysfp:', $argument); + $serviceContainer->addServicesYmlFilePath($ymlServicesFilePath[1]); + } + } + $server = $serviceContainer->getContainerBuilder()->get('process.pool.server'); + $server->setParentProcessPath(''); + $server->start(); + exit(); +} +$consoleApplication = $serviceContainer->getContainerBuilder()->get('nhds.kojo.symfony.component.console.application'); +$consoleApplication->run(); \ No newline at end of file diff --git a/composer.json b/composer.json index 355d3f70..0e56c08a 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { - "name": "nhds/jobs", + "name": "neighborhoods/kojo", "type": "library", - "description": "NHDS Jobs is meant to solve the problem of easily writing distributed, fast, fault tolerant tasks.", + "description": "Neighborhoods Kōjō is a distributed task manager.", "license": "proprietary", "keywords": [], "authors": [ @@ -29,20 +29,19 @@ "symfony/finder": "^4.0" }, "bin": [ - "src/bin/jobs", - "src/bin/server" + "bin/kojo" ], "autoload": { "psr-4": { - "NHDS\\Jobs\\": "src", - "NHDS\\Toolkit\\": "nhdstoolkitsrc" + "Neighborhoods\\Kojo\\": "src", + "Neighborhoods\\Toolkit\\": "nhdstoolkitsrc" } }, "autoload-dev": { "psr-4": { - "NHDS\\Jobs\\Test\\": "tests", + "Neighborhoods\\Kojo\\Test\\": "tests", "Neighborhoods\\Scaffolding\\": "nhdswatchsrc", - "NHDS\\Jobs\\Example\\": "example" + "Neighborhoods\\Kojo\\Example\\": "example" } } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index 0518af75..cdb931b2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "616476aa0db15d2c2a5199087edf6922", + "content-hash": "3e1e0f86ef76f67966fad84644596f1b", "packages": [ { "name": "dragonmantank/cron-expression", @@ -317,16 +317,16 @@ }, { "name": "psr/simple-cache", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/simple-cache.git", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24" + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/753fa598e8f3b9966c886fe13f370baa45ef0e24", - "reference": "753fa598e8f3b9966c886fe13f370baa45ef0e24", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", "shasum": "" }, "require": { @@ -361,20 +361,20 @@ "psr-16", "simple-cache" ], - "time": "2017-01-02T13:31:39+00:00" + "time": "2017-10-23T01:57:42+00:00" }, { "name": "symfony/cache", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "e901ff335ef5e8ef57ee9b8e098bd54a1d39a857" + "reference": "fcffcf7f26d232b64329f37182defe253caa06b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/e901ff335ef5e8ef57ee9b8e098bd54a1d39a857", - "reference": "e901ff335ef5e8ef57ee9b8e098bd54a1d39a857", + "url": "https://api.github.com/repos/symfony/cache/zipball/fcffcf7f26d232b64329f37182defe253caa06b0", + "reference": "fcffcf7f26d232b64329f37182defe253caa06b0", "shasum": "" }, "require": { @@ -430,20 +430,20 @@ "caching", "psr6" ], - "time": "2018-01-18T22:19:33+00:00" + "time": "2018-02-11T17:17:44+00:00" }, { "name": "symfony/config", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "ecd917899167922086ddb3247aa43eb1c418fcb2" + "reference": "289eadd3771f7682ea2540e4925861c18ec5b4d0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/ecd917899167922086ddb3247aa43eb1c418fcb2", - "reference": "ecd917899167922086ddb3247aa43eb1c418fcb2", + "url": "https://api.github.com/repos/symfony/config/zipball/289eadd3771f7682ea2540e4925861c18ec5b4d0", + "reference": "289eadd3771f7682ea2540e4925861c18ec5b4d0", "shasum": "" }, "require": { @@ -454,6 +454,8 @@ "symfony/finder": "<3.4" }, "require-dev": { + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~3.4|~4.0", "symfony/finder": "~3.4|~4.0", "symfony/yaml": "~3.4|~4.0" }, @@ -490,20 +492,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:06:11+00:00" + "time": "2018-02-04T16:43:51+00:00" }, { "name": "symfony/console", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" + "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", + "url": "https://api.github.com/repos/symfony/console/zipball/555c8dbe0ae9e561740451eabdbed2cc554b6a51", + "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51", "shasum": "" }, "require": { @@ -558,20 +560,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:06:29+00:00" + "time": "2018-02-26T15:55:47+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "f78ca49c6360c710ca8e316511e71a23b10e3bf2" + "reference": "93ad14f124beacf16894b64bb5b3cdd5b4367e38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/f78ca49c6360c710ca8e316511e71a23b10e3bf2", - "reference": "f78ca49c6360c710ca8e316511e71a23b10e3bf2", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/93ad14f124beacf16894b64bb5b3cdd5b4367e38", + "reference": "93ad14f124beacf16894b64bb5b3cdd5b4367e38", "shasum": "" }, "require": { @@ -629,11 +631,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:29:16+00:00" + "time": "2018-03-05T18:28:26+00:00" }, { "name": "symfony/expression-language", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", @@ -683,16 +685,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed" + "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/760e47a4ee64b4c48f4b30017011e09d4c0f05ed", - "reference": "760e47a4ee64b4c48f4b30017011e09d4c0f05ed", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21", + "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21", "shasum": "" }, "require": { @@ -728,7 +730,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-02-22T10:50:29+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -791,16 +793,16 @@ }, { "name": "symfony/yaml", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028" + "reference": "de5f125ea39de846b90b313b2cfb031a0152d223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ffc60bda1d4a00ec0b32eeabf39dc017bf480028", - "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028", + "url": "https://api.github.com/repos/symfony/yaml/zipball/de5f125ea39de846b90b313b2cfb031a0152d223", + "reference": "de5f125ea39de846b90b313b2cfb031a0152d223", "shasum": "" }, "require": { @@ -845,7 +847,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:06:11+00:00" + "time": "2018-02-19T20:08:53+00:00" }, { "name": "zendframework/zend-code", @@ -2480,16 +2482,16 @@ }, { "name": "symfony/finder", - "version": "v4.0.4", + "version": "v4.0.6", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" + "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", + "url": "https://api.github.com/repos/symfony/finder/zipball/44a796d2ecc2a16a5fc8f2956a34ee617934d55f", + "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f", "shasum": "" }, "require": { @@ -2525,7 +2527,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-03-05T18:28:26+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/config/CacheItemPool/Factory.yml b/config/CacheItemPool/Factory.yml similarity index 50% rename from src/config/CacheItemPool/Factory.yml rename to config/CacheItemPool/Factory.yml index 72a0ccae..f90ac039 100644 --- a/src/config/CacheItemPool/Factory.yml +++ b/config/CacheItemPool/Factory.yml @@ -1,10 +1,10 @@ services: - nhds.jobs.cache_item_pool.factory: - class: NHDS\Jobs\CacheItemPool\Factory + neighborhoods.kojo.cache_item_pool.factory: + class: Neighborhoods\Kojo\CacheItemPool\Factory public: false shared: true calls: - [setRedisRepository, ['@redis.repository']] cache_item_pool.factory: - alias: nhds.jobs.cache_item_pool.factory + alias: neighborhoods.kojo.cache_item_pool.factory public: false \ No newline at end of file diff --git a/src/config/CacheItemPool/Repository.yml b/config/CacheItemPool/Repository.yml similarity index 57% rename from src/config/CacheItemPool/Repository.yml rename to config/CacheItemPool/Repository.yml index ba3d24bf..b8e0a3c0 100644 --- a/src/config/CacheItemPool/Repository.yml +++ b/config/CacheItemPool/Repository.yml @@ -1,11 +1,11 @@ services: - nhds.jobs.cache_item_pool.repository: - class: NHDS\Jobs\CacheItemPool\Repository + neighborhoods.kojo.cache_item_pool.repository: + class: Neighborhoods\Kojo\CacheItemPool\Repository shared: true public: false calls: - [setCacheItemPoolFactory, ['@cache_item_pool.factory']] - [setProcessRegistry, ['@process.registry']] cache_item_pool.repository: - alias: nhds.jobs.cache_item_pool.repository + alias: neighborhoods.kojo.cache_item_pool.repository public: false \ No newline at end of file diff --git a/config/Console/Command/Db/Setup/Install.yml b/config/Console/Command/Db/Setup/Install.yml new file mode 100644 index 00000000..545d3993 --- /dev/null +++ b/config/Console/Command/Db/Setup/Install.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.console.command.db.setup.install: + class: Neighborhoods\Kojo\Console\Command\Db\Setup\Install + calls: + - [setBootstrap, ['@worker.bootstrap']] + - [setDbSetup, ['@db.setup']] + console.command.db.setup.install: + alias: neighborhoods.kojo.console.command.db.setup.install \ No newline at end of file diff --git a/config/Console/Command/Db/TearDown/Uninstall.yml b/config/Console/Command/Db/TearDown/Uninstall.yml new file mode 100644 index 00000000..1a061330 --- /dev/null +++ b/config/Console/Command/Db/TearDown/Uninstall.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.console.command.db.tear_down.uninstall: + class: Neighborhoods\Kojo\Console\Command\Db\TearDown\Uninstall + calls: + - [setBootstrap, ['@worker.bootstrap']] + - [setDbTearDown, ['@db.tear_down']] + console.command.db.tear_down.uninstall: + alias: neighborhoods.kojo.console.command.db.tear_down.uninstall \ No newline at end of file diff --git a/config/Console/Command/Process/Pool/Server/Start.yml b/config/Console/Command/Process/Pool/Server/Start.yml new file mode 100644 index 00000000..98fb0007 --- /dev/null +++ b/config/Console/Command/Process/Pool/Server/Start.yml @@ -0,0 +1,5 @@ +services: + neighborhoods.kojo.console.command.process.pool.server.start: + class: Neighborhoods\Kojo\Console\Command\Process\Pool\Server\Start + console.command.process.pool.server.start: + alias: neighborhoods.kojo.console.command.process.pool.server.start \ No newline at end of file diff --git a/src/config/Data/Job.yml b/config/Data/Job.yml similarity index 52% rename from src/config/Data/Job.yml rename to config/Data/Job.yml index c2296eaf..bdc7e7aa 100644 --- a/src/config/Data/Job.yml +++ b/config/Data/Job.yml @@ -1,8 +1,8 @@ services: - nhds.jobs.data.job: - class: NHDS\Jobs\Data\Job + neighborhoods.kojo.data.job: + class: Neighborhoods\Kojo\Data\Job shared: false calls: - [addDbConnectionContainer, ['@db.connection.container-job']] data.job: - alias: nhds.jobs.data.job \ No newline at end of file + alias: neighborhoods.kojo.data.job \ No newline at end of file diff --git a/src/config/Data/Job/Collection/CrashDetection.yml b/config/Data/Job/Collection/CrashDetection.yml similarity index 60% rename from src/config/Data/Job/Collection/CrashDetection.yml rename to config/Data/Job/Collection/CrashDetection.yml index 9bb936d1..17b0db63 100644 --- a/src/config/Data/Job/Collection/CrashDetection.yml +++ b/config/Data/Job/Collection/CrashDetection.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.data.job.collection.crashdetection: - class: NHDS\Jobs\Data\Job\Collection\CrashDetection + neighborhoods.kojo.data.job.collection.crashdetection: + class: Neighborhoods\Kojo\Data\Job\Collection\CrashDetection shared: false calls: - [setModel, ['@data.job']] @@ -8,4 +8,4 @@ services: - [addDbConnectionContainer, ['@db.connection.container-job']] - [setLogger, ['@process.pool.logger']] data.job.collection.crashdetection: - alias: nhds.jobs.data.job.collection.crashdetection \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.crashdetection \ No newline at end of file diff --git a/src/config/Data/Job/Collection/Delete.yml b/config/Data/Job/Collection/Delete.yml similarity index 61% rename from src/config/Data/Job/Collection/Delete.yml rename to config/Data/Job/Collection/Delete.yml index a7af668d..f74c0181 100644 --- a/src/config/Data/Job/Collection/Delete.yml +++ b/config/Data/Job/Collection/Delete.yml @@ -1,10 +1,10 @@ services: - nhds.jobs.data.job.collection.delete: - class: NHDS\Jobs\Data\Job\Collection\Delete + neighborhoods.kojo.data.job.collection.delete: + class: Neighborhoods\Kojo\Data\Job\Collection\Delete calls: - [setModel, ['@data.job']] - [addDbConnectionContainer, ['@db.connection.container-job']] - [setIterator, ['@data.job.collection.iterator']] - [setLogger, ['@process.pool.logger']] data.job.collection.delete: - alias: nhds.jobs.data.job.collection.delete \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.delete \ No newline at end of file diff --git a/config/Data/Job/Collection/Iterator.yml b/config/Data/Job/Collection/Iterator.yml new file mode 100644 index 00000000..ae7b270b --- /dev/null +++ b/config/Data/Job/Collection/Iterator.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.data.job.collection.iterator: + class: Neighborhoods\Kojo\Data\Job\Collection\Iterator + shared: false + data.job.collection.iterator: + alias: neighborhoods.kojo.data.job.collection.iterator \ No newline at end of file diff --git a/src/config/Data/Job/Collection/Schedule/LimitCheck.yml b/config/Data/Job/Collection/Schedule/LimitCheck.yml similarity index 58% rename from src/config/Data/Job/Collection/Schedule/LimitCheck.yml rename to config/Data/Job/Collection/Schedule/LimitCheck.yml index f2963c18..e6727129 100644 --- a/src/config/Data/Job/Collection/Schedule/LimitCheck.yml +++ b/config/Data/Job/Collection/Schedule/LimitCheck.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.data.job.collection.schedule.limitcheck: - class: NHDS\Jobs\Data\Job\Collection\Schedule\LimitCheck + neighborhoods.kojo.data.job.collection.schedule.limitcheck: + class: Neighborhoods\Kojo\Data\Job\Collection\Schedule\LimitCheck shared: false calls: - [setModel, ['@data.job']] @@ -8,4 +8,4 @@ services: - [addDbConnectionContainer, ['@db.connection.container-job']] - [setLogger, ['@process.pool.logger']] data.job.collection.schedule.limitcheck: - alias: nhds.jobs.data.job.collection.schedule.limitcheck \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.schedule.limitcheck \ No newline at end of file diff --git a/src/config/Data/Job/Collection/ScheduleLimit.yml b/config/Data/Job/Collection/ScheduleLimit.yml similarity index 60% rename from src/config/Data/Job/Collection/ScheduleLimit.yml rename to config/Data/Job/Collection/ScheduleLimit.yml index b0f3957f..05e762b0 100644 --- a/src/config/Data/Job/Collection/ScheduleLimit.yml +++ b/config/Data/Job/Collection/ScheduleLimit.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.data.job.collection.schedulelimit: - class: NHDS\Jobs\Data\Job\Collection\ScheduleLimit + neighborhoods.kojo.data.job.collection.schedulelimit: + class: Neighborhoods\Kojo\Data\Job\Collection\ScheduleLimit shared: false calls: - [setModel, ['@data.job']] @@ -8,4 +8,4 @@ services: - [addDbConnectionContainer, ['@db.connection.container-job']] - [setLogger, ['@process.pool.logger']] data.job.collection.schedulelimit: - alias: nhds.jobs.data.job.collection.schedulelimit \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.schedulelimit \ No newline at end of file diff --git a/src/config/Data/Job/Collection/Scheduler.yml b/config/Data/Job/Collection/Scheduler.yml similarity index 61% rename from src/config/Data/Job/Collection/Scheduler.yml rename to config/Data/Job/Collection/Scheduler.yml index fb1b5a82..f9c25fe6 100644 --- a/src/config/Data/Job/Collection/Scheduler.yml +++ b/config/Data/Job/Collection/Scheduler.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.data.job.collection.scheduler: - class: NHDS\Jobs\Data\Job\Collection\Scheduler + neighborhoods.kojo.data.job.collection.scheduler: + class: Neighborhoods\Kojo\Data\Job\Collection\Scheduler shared: false calls: - [setModel, ['@data.job']] @@ -8,4 +8,4 @@ services: - [addDbConnectionContainer, ['@db.connection.container-job']] - [setLogger, ['@process.pool.logger']] data.job.collection.scheduler: - alias: nhds.jobs.data.job.collection.scheduler \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.scheduler \ No newline at end of file diff --git a/src/config/Data/Job/Collection/Selector.yml b/config/Data/Job/Collection/Selector.yml similarity index 62% rename from src/config/Data/Job/Collection/Selector.yml rename to config/Data/Job/Collection/Selector.yml index 3ceff355..5ce37093 100644 --- a/src/config/Data/Job/Collection/Selector.yml +++ b/config/Data/Job/Collection/Selector.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.data.job.collection.selector: - class: NHDS\Jobs\Data\Job\Collection\Selector + neighborhoods.kojo.data.job.collection.selector: + class: Neighborhoods\Kojo\Data\Job\Collection\Selector shared: false calls: - [setModel, ['@data.job']] @@ -8,4 +8,4 @@ services: - [addDbConnectionContainer, ['@db.connection.container-job']] - [setLogger, ['@process.pool.logger']] data.job.collection.selector: - alias: nhds.jobs.data.job.collection.selector \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.selector \ No newline at end of file diff --git a/src/config/Data/Job/Type.yml b/config/Data/Job/Type.yml similarity index 50% rename from src/config/Data/Job/Type.yml rename to config/Data/Job/Type.yml index 5679c6d1..37bc7049 100644 --- a/src/config/Data/Job/Type.yml +++ b/config/Data/Job/Type.yml @@ -1,8 +1,8 @@ services: - nhds.jobs.data.job.type: - class: NHDS\Jobs\Data\Job\Type + neighborhoods.kojo.data.job.type: + class: Neighborhoods\Kojo\Data\Job\Type shared: false calls: - [addDbConnectionContainer, ['@db.connection.container-job']] data.job.type: - alias: nhds.jobs.data.job.type \ No newline at end of file + alias: neighborhoods.kojo.data.job.type \ No newline at end of file diff --git a/config/Data/Job/Type/Collection/Iterator.yml b/config/Data/Job/Type/Collection/Iterator.yml new file mode 100644 index 00000000..eaf0acf5 --- /dev/null +++ b/config/Data/Job/Type/Collection/Iterator.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.data.job.type.collection.iterator: + class: Neighborhoods\Kojo\Data\Job\Type\Collection\Iterator + shared: false + data.job.type.collection.iterator: + alias: neighborhoods.kojo.data.job.type.collection.iterator \ No newline at end of file diff --git a/src/config/Data/Job/Type/Collection/Scheduler.yml b/config/Data/Job/Type/Collection/Scheduler.yml similarity index 57% rename from src/config/Data/Job/Type/Collection/Scheduler.yml rename to config/Data/Job/Type/Collection/Scheduler.yml index 65214368..ee41b020 100644 --- a/src/config/Data/Job/Type/Collection/Scheduler.yml +++ b/config/Data/Job/Type/Collection/Scheduler.yml @@ -1,10 +1,10 @@ services: - nhds.jobs.data.job.type.collection.scheduler: - class: NHDS\Jobs\Data\Job\Type\Collection\Scheduler + neighborhoods.kojo.data.job.type.collection.scheduler: + class: Neighborhoods\Kojo\Data\Job\Type\Collection\Scheduler shared: false calls: - [setModel, ['@data.job.type']] - [setIterator, ['@data.job.type.collection.iterator']] - [addDbConnectionContainer, ['@db.connection.container-job']] data.job.type.collection.scheduler: - alias: nhds.jobs.data.job.type.collection.scheduler \ No newline at end of file + alias: neighborhoods.kojo.data.job.type.collection.scheduler \ No newline at end of file diff --git a/config/Db/Connection/Container.yml b/config/Db/Connection/Container.yml new file mode 100644 index 00000000..18341e7e --- /dev/null +++ b/config/Db/Connection/Container.yml @@ -0,0 +1,13 @@ +services: + neighborhoods.kojo.db.connection.container-job: + class: Neighborhoods\Kojo\Db\Connection\Container + calls: + - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_JOB]] + db.connection.container-job: + alias: neighborhoods.kojo.db.connection.container-job + neighborhoods.kojo.db.connection.container-schema: + class: Neighborhoods\Kojo\Db\Connection\Container + calls: + - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_SCHEMA]] + db.connection.container-schema: + alias: neighborhoods.kojo.db.connection.container-schema \ No newline at end of file diff --git a/src/config/Db/Setup.yml b/config/Db/Setup.yml similarity index 80% rename from src/config/Db/Setup.yml rename to config/Db/Setup.yml index 090c2ea6..73af1b4a 100644 --- a/src/config/Db/Setup.yml +++ b/config/Db/Setup.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.db.setup: - class: NHDS\Jobs\Db\Setup + neighborhoods.kojo.db.setup: + class: Neighborhoods\Kojo\Db\Setup calls: - [addVersion, ["@db.setup.schema.version.0_0_0"]] - [addVersion, ["@db.setup.schema.version.1_0_0"]] @@ -10,4 +10,4 @@ services: - [addVersion, ["@db.setup.schema.version.5_0_0"]] - [addVersion, ["@db.setup.schema.version_6_0_0"]] db.setup: - alias: nhds.jobs.db.setup \ No newline at end of file + alias: neighborhoods.kojo.db.setup \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_0_0_0.yml b/config/Db/Setup/Schema/Version_0_0_0.yml new file mode 100644 index 00000000..715efc46 --- /dev/null +++ b/config/Db/Setup/Schema/Version_0_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version.0_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_0_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.setup.schema.version.0_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.0_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_1_0_0.yml b/config/Db/Setup/Schema/Version_1_0_0.yml new file mode 100644 index 00000000..d464b9ce --- /dev/null +++ b/config/Db/Setup/Schema/Version_1_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version.1_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_1_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.setup.schema.version.1_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.1_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_2_0_0.yml b/config/Db/Setup/Schema/Version_2_0_0.yml new file mode 100644 index 00000000..0add8450 --- /dev/null +++ b/config/Db/Setup/Schema/Version_2_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version.2_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_2_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.setup.schema.version.2_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.2_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_3_0_0.yml b/config/Db/Setup/Schema/Version_3_0_0.yml new file mode 100644 index 00000000..57e4bfb3 --- /dev/null +++ b/config/Db/Setup/Schema/Version_3_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version.3_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_3_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.setup.schema.version.3_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.3_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_4_0_0.yml b/config/Db/Setup/Schema/Version_4_0_0.yml new file mode 100644 index 00000000..b959a1fe --- /dev/null +++ b/config/Db/Setup/Schema/Version_4_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version.4_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_4_0_0 + calls: + - [addDbConnectionContainer, ["@neighborhoods.kojo.db.connection.container-schema"]] + db.setup.schema.version.4_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.4_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_5_0_0.yml b/config/Db/Setup/Schema/Version_5_0_0.yml new file mode 100644 index 00000000..23a2b61d --- /dev/null +++ b/config/Db/Setup/Schema/Version_5_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version.5_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_5_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.setup.schema.version.5_0_0: + alias: neighborhoods.kojo.db.setup.schema.version.5_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_6_0_0.yml b/config/Db/Setup/Schema/Version_6_0_0.yml new file mode 100644 index 00000000..d0e9b834 --- /dev/null +++ b/config/Db/Setup/Schema/Version_6_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.setup.schema.version_6_0_0: + class: Neighborhoods\Kojo\Db\Setup\Schema\Version_6_0_0 + calls: + - [addDbConnectionContainer, ['@db.connection.container-schema']] + db.setup.schema.version_6_0_0: + alias: neighborhoods.kojo.db.setup.schema.version_6_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown.yml b/config/Db/TearDown.yml similarity index 80% rename from src/config/Db/TearDown.yml rename to config/Db/TearDown.yml index 78799576..a0fcf70c 100644 --- a/src/config/Db/TearDown.yml +++ b/config/Db/TearDown.yml @@ -1,7 +1,7 @@ services: - nhds.jobs.db.tear_down: + neighborhoods.kojo.db.tear_down: public: true - class: NHDS\Jobs\Db\TearDown + class: Neighborhoods\Kojo\Db\TearDown calls: - [addVersion, ["@db.tear_down.schema.version_6_0_0"]] - [addVersion, ["@db.tear_down.schema.version.5_0_0"]] @@ -12,4 +12,4 @@ services: - [addVersion, ["@db.tear_down.schema.version.0_0_0"]] db.tear_down: public: true - alias: nhds.jobs.db.tear_down \ No newline at end of file + alias: neighborhoods.kojo.db.tear_down \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_0_0_0.yml b/config/Db/TearDown/Schema/Version_0_0_0.yml new file mode 100644 index 00000000..027e440a --- /dev/null +++ b/config/Db/TearDown/Schema/Version_0_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.0_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_0_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.tear_down.schema.version.0_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.0_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_1_0_0.yml b/config/Db/TearDown/Schema/Version_1_0_0.yml new file mode 100644 index 00000000..014aae1b --- /dev/null +++ b/config/Db/TearDown/Schema/Version_1_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.1_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_1_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.tear_down.schema.version.1_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.1_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_2_0_0.yml b/config/Db/TearDown/Schema/Version_2_0_0.yml new file mode 100644 index 00000000..ca26251c --- /dev/null +++ b/config/Db/TearDown/Schema/Version_2_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.2_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_2_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.tear_down.schema.version.2_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.2_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_3_0_0.yml b/config/Db/TearDown/Schema/Version_3_0_0.yml new file mode 100644 index 00000000..43bb384b --- /dev/null +++ b/config/Db/TearDown/Schema/Version_3_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.3_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_3_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.tear_down.schema.version.3_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.3_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_4_0_0.yml b/config/Db/TearDown/Schema/Version_4_0_0.yml new file mode 100644 index 00000000..0cb810c0 --- /dev/null +++ b/config/Db/TearDown/Schema/Version_4_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.4_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_4_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.tear_down.schema.version.4_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.4_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_5_0_0.yml b/config/Db/TearDown/Schema/Version_5_0_0.yml new file mode 100644 index 00000000..cfd29269 --- /dev/null +++ b/config/Db/TearDown/Schema/Version_5_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version.5_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_5_0_0 + calls: + - [addDbConnectionContainer, ["@db.connection.container-schema"]] + db.tear_down.schema.version.5_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version.5_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_6_0_0.yml b/config/Db/TearDown/Schema/Version_6_0_0.yml new file mode 100644 index 00000000..9d66f538 --- /dev/null +++ b/config/Db/TearDown/Schema/Version_6_0_0.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.db.tear_down.schema.version_6_0_0: + class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_6_0_0 + calls: + - [addDbConnectionContainer, ['@db.connection.container-schema']] + db.tear_down.schema.version_6_0_0: + alias: neighborhoods.kojo.db.tear_down.schema.version_6_0_0 \ No newline at end of file diff --git a/src/config/Foreman.yml b/config/Foreman.yml similarity index 88% rename from src/config/Foreman.yml rename to config/Foreman.yml index 1c71c026..bd83f333 100644 --- a/src/config/Foreman.yml +++ b/config/Foreman.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.foreman: - class: NHDS\Jobs\Foreman + neighborhoods.kojo.foreman: + class: Neighborhoods\Kojo\Foreman shared: false public: false calls: @@ -18,5 +18,5 @@ services: - [setStateService, ['@state.service']] - [setMessageBroker, ['@message.broker.redis']] foreman: - alias: nhds.jobs.foreman + alias: neighborhoods.kojo.foreman public: false \ No newline at end of file diff --git a/src/config/Maintainer.yml b/config/Maintainer.yml similarity index 90% rename from src/config/Maintainer.yml rename to config/Maintainer.yml index 4fd4e6c9..5969d1e1 100644 --- a/src/config/Maintainer.yml +++ b/config/Maintainer.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.maintainer: - class: NHDS\Jobs\Maintainer + neighborhoods.kojo.maintainer: + class: Neighborhoods\Kojo\Maintainer shared: false public: false calls: @@ -19,5 +19,5 @@ services: - [setLogger, ['@process.pool.logger']] - [setMaintainerDelete, ['@maintainer.delete']] maintainer: - alias: nhds.jobs.maintainer + alias: neighborhoods.kojo.maintainer public: false \ No newline at end of file diff --git a/src/config/Maintainer/Delete.yml b/config/Maintainer/Delete.yml similarity index 71% rename from src/config/Maintainer/Delete.yml rename to config/Maintainer/Delete.yml index 386bc3ce..9593344d 100644 --- a/src/config/Maintainer/Delete.yml +++ b/config/Maintainer/Delete.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.maintainer.delete: - class: NHDS\Jobs\Maintainer\Delete + neighborhoods.kojo.maintainer.delete: + class: Neighborhoods\Kojo\Maintainer\Delete calls: - [setLogger, ['@process.pool.logger']] - [setJobCollectionDelete, ['@data.job.collection.delete']] @@ -9,4 +9,4 @@ services: - [setPageSize, [50]] - [setOffset, [50]] maintainer.delete: - alias: nhds.jobs.maintainer.delete \ No newline at end of file + alias: neighborhoods.kojo.maintainer.delete \ No newline at end of file diff --git a/src/config/Message/Broker/Redis.yml b/config/Message/Broker/Redis.yml similarity index 57% rename from src/config/Message/Broker/Redis.yml rename to config/Message/Broker/Redis.yml index baf6c82c..cd9cc56a 100644 --- a/src/config/Message/Broker/Redis.yml +++ b/config/Message/Broker/Redis.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.message.broker.redis: - class: NHDS\Jobs\Message\Broker\Redis + neighborhoods.kojo.message.broker.redis: + class: Neighborhoods\Kojo\Message\Broker\Redis shared: false calls: - [setLogger, ['@process.pool.logger']] @@ -8,12 +8,12 @@ services: - [setPublishChannelName, ['job_listener_publish']] - [setRedisRepository, ['@redis.repository']] message.broker.redis: - alias: nhds.jobs.message.broker.redis - nhds.jobs.message.broker.redis[process.listener.mutex.redis]: - class: NHDS\Jobs\Message\Broker\Redis + alias: neighborhoods.kojo.message.broker.redis + neighborhoods.kojo.message.broker.redis[process.listener.mutex.redis]: + class: Neighborhoods\Kojo\Message\Broker\Redis shared: false calls: - [setLogger, ['@process.pool.logger']] - [setRedisRepository, ['@redis.repository']] message.broker.redis[process.listener.mutex.redis]: - alias: nhds.jobs.message.broker.redis[process.listener.mutex.redis] \ No newline at end of file + alias: neighborhoods.kojo.message.broker.redis[process.listener.mutex.redis] \ No newline at end of file diff --git a/src/config/Message/Broker/Type/Collection.yml b/config/Message/Broker/Type/Collection.yml similarity index 56% rename from src/config/Message/Broker/Type/Collection.yml rename to config/Message/Broker/Type/Collection.yml index 897759ec..ca252f4b 100644 --- a/src/config/Message/Broker/Type/Collection.yml +++ b/config/Message/Broker/Type/Collection.yml @@ -1,8 +1,8 @@ services: - nhds.jobs.message.broker.type.collection-job: - class: NHDS\Jobs\Message\Broker\Type\Collection + neighborhoods.kojo.message.broker.type.collection-job: + class: Neighborhoods\Kojo\Message\Broker\Type\Collection calls: - [addBrokerType, ['job_broker', '@message.broker.redis']] - [addBrokerType, ['process.listener.mutex.redis', '@message.broker.redis[process.listener.mutex.redis]']] message.broker.type.collection-job: - alias: nhds.jobs.message.broker.type.collection-job \ No newline at end of file + alias: neighborhoods.kojo.message.broker.type.collection-job \ No newline at end of file diff --git a/config/Process.yml b/config/Process.yml new file mode 100644 index 00000000..e002b47d --- /dev/null +++ b/config/Process.yml @@ -0,0 +1,2 @@ +parameters: + process.title.prefix: 'neighborhoods-kojo: ' \ No newline at end of file diff --git a/src/config/Process/Collection.yml b/config/Process/Collection.yml similarity index 55% rename from src/config/Process/Collection.yml rename to config/Process/Collection.yml index a6785636..033016fb 100644 --- a/src/config/Process/Collection.yml +++ b/config/Process/Collection.yml @@ -1,34 +1,34 @@ services: - nhds.jobs.process.collection: + neighborhoods.kojo.process.collection: shared: true - class: NHDS\Jobs\Process\Collection + class: Neighborhoods\Kojo\Process\Collection calls: - [setIterator, ['@process.collection.iterator']] - [addProcessPrototype, ['@process.listener.command']] - [addProcessPrototype, ['@process.job.required']] - [addProcessPrototype, ['@process.job']] process.collection: - alias: nhds.jobs.process.collection - nhds.jobs.process.collection-server: + alias: neighborhoods.kojo.process.collection + neighborhoods.kojo.process.collection-server: shared: true - class: NHDS\Jobs\Process\Collection + class: Neighborhoods\Kojo\Process\Collection calls: - [setIterator, ['@process.collection.iterator']] - [addProcessPrototype, ['@process.root']] process.collection-server: - alias: nhds.jobs.process.collection-server - nhds.jobs.process.collection-job: + alias: neighborhoods.kojo.process.collection-server + neighborhoods.kojo.process.collection-job: shared: true - class: NHDS\Jobs\Process\Collection + class: Neighborhoods\Kojo\Process\Collection calls: - [setIterator, ['@process.collection.iterator']] - [addProcessPrototype, ['@process.listener.mutex.redis']] process.collection-job: - alias: nhds.jobs.process.collection-job - nhds.jobs.process.collection-empty: + alias: neighborhoods.kojo.process.collection-job + neighborhoods.kojo.process.collection-empty: shared: true - class: NHDS\Jobs\Process\Collection + class: Neighborhoods\Kojo\Process\Collection calls: - [setIterator, ['@process.collection.iterator']] process.collection-empty: - alias: nhds.jobs.process.collection-empty \ No newline at end of file + alias: neighborhoods.kojo.process.collection-empty \ No newline at end of file diff --git a/config/Process/Collection/Iterator.yml b/config/Process/Collection/Iterator.yml new file mode 100644 index 00000000..95d4aad2 --- /dev/null +++ b/config/Process/Collection/Iterator.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.process.collection.iterator: + shared: false + class: Neighborhoods\Kojo\Process\Collection\Iterator + process.collection.iterator: + alias: neighborhoods.kojo.process.collection.iterator \ No newline at end of file diff --git a/src/config/Process/Job.yml b/config/Process/Job.yml similarity index 86% rename from src/config/Process/Job.yml rename to config/Process/Job.yml index 688839fc..8177893f 100644 --- a/src/config/Process/Job.yml +++ b/config/Process/Job.yml @@ -1,7 +1,7 @@ services: - nhds.jobs.process.job: + neighborhoods.kojo.process.job: shared: false - class: NHDS\Jobs\Process\Job + class: Neighborhoods\Kojo\Process\Job calls: - [setLogger, ['@process.pool.logger']] - [setForeman, ['@foreman']] @@ -18,4 +18,4 @@ services: - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.job: - alias: nhds.jobs.process.job \ No newline at end of file + alias: neighborhoods.kojo.process.job \ No newline at end of file diff --git a/src/config/Process/Job/Required.yml b/config/Process/Job/Required.yml similarity index 83% rename from src/config/Process/Job/Required.yml rename to config/Process/Job/Required.yml index 1f4bdec9..1644fc1a 100644 --- a/src/config/Process/Job/Required.yml +++ b/config/Process/Job/Required.yml @@ -1,7 +1,7 @@ services: - nhds.jobs.process.job.required: + neighborhoods.kojo.process.job.required: shared: false - class: NHDS\Jobs\Process\Job\Required + class: Neighborhoods\Kojo\Process\Job\Required calls: - [setLogger, ['@process.pool.logger']] - [setForeman, ['@foreman']] @@ -18,4 +18,4 @@ services: - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.job.required: - alias: nhds.jobs.process.job.required \ No newline at end of file + alias: neighborhoods.kojo.process.job.required \ No newline at end of file diff --git a/src/config/Process/Listener/Command.yml b/config/Process/Listener/Command.yml similarity index 74% rename from src/config/Process/Listener/Command.yml rename to config/Process/Listener/Command.yml index 46faf8ff..b468be7d 100644 --- a/src/config/Process/Listener/Command.yml +++ b/config/Process/Listener/Command.yml @@ -1,9 +1,9 @@ services: - nhds.jobs.process.listener.command: - class: NHDS\Jobs\Process\Listener\Command + neighborhoods.kojo.process.listener.command: + class: Neighborhoods\Kojo\Process\Listener\Command calls: - [setTypeCode, ['listener.command']] - - [setBrokerTypeCollection, ['@nhds.jobs.message.broker.type.collection-job']] + - [setBrokerTypeCollection, ['@neighborhoods.kojo.message.broker.type.collection-job']] - [setBrokerTypeCode, ['job_broker']] - [setLogger, ['@process.pool.logger']] - [setExpressionLanguage, ['@symfony.component.expressionlanguage.expressionlanguage']] @@ -16,4 +16,4 @@ services: - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.listener.command: - alias: nhds.jobs.process.listener.command \ No newline at end of file + alias: neighborhoods.kojo.process.listener.command \ No newline at end of file diff --git a/src/config/Process/Listener/Mutex/Redis.yml b/config/Process/Listener/Mutex/Redis.yml similarity index 72% rename from src/config/Process/Listener/Mutex/Redis.yml rename to config/Process/Listener/Mutex/Redis.yml index af6d0686..5323162d 100644 --- a/src/config/Process/Listener/Mutex/Redis.yml +++ b/config/Process/Listener/Mutex/Redis.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.process.listener.mutex.redis: - class: NHDS\Jobs\Process\Listener\Mutex\Redis + neighborhoods.kojo.process.listener.mutex.redis: + class: Neighborhoods\Kojo\Process\Listener\Mutex\Redis public: false shared: false calls: @@ -10,12 +10,12 @@ services: - [setProcessRegistry, ['@process.registry']] - [setTerminationSignalNumber, ['@=constant("SIGKILL")']] - [setUuidMaximumInteger, [9999999999]] - - [setBrokerTypeCollection, ['@nhds.jobs.message.broker.type.collection-job']] + - [setBrokerTypeCollection, ['@neighborhoods.kojo.message.broker.type.collection-job']] - [setBrokerTypeCode, ['process.listener.mutex.redis']] - [setProcessPoolFactory, ['@process.pool.factory-empty']] - [setRedisFactory, ['@redis.factory']] - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.listener.mutex.redis: - alias: nhds.jobs.process.listener.mutex.redis + alias: neighborhoods.kojo.process.listener.mutex.redis public: false \ No newline at end of file diff --git a/src/config/Process/Pool.yml b/config/Process/Pool.yml similarity index 55% rename from src/config/Process/Pool.yml rename to config/Process/Pool.yml index e9592564..98577634 100644 --- a/src/config/Process/Pool.yml +++ b/config/Process/Pool.yml @@ -1,9 +1,9 @@ services: - nhds.jobs.process.pool: - class: NHDS\Jobs\Process\Pool + neighborhoods.kojo.process.pool: + class: Neighborhoods\Kojo\Process\Pool shared: false calls: - [setLogger, ['@process.pool.logger']] - [setProcessSignal, ['@process.signal']] process.pool: - alias: nhds.jobs.process.pool \ No newline at end of file + alias: neighborhoods.kojo.process.pool \ No newline at end of file diff --git a/src/config/Process/Pool/Factory.yml b/config/Process/Pool/Factory.yml similarity index 80% rename from src/config/Process/Pool/Factory.yml rename to config/Process/Pool/Factory.yml index 8ad91cc0..2ef29c91 100644 --- a/src/config/Process/Pool/Factory.yml +++ b/config/Process/Pool/Factory.yml @@ -12,8 +12,8 @@ parameters: process_pool_strategy-empty.child_process_wait_throttle: 0 process_pool_strategy-empty.max_alarm_time: 0 services: - nhds.jobs.process.pool.factory: - class: NHDS\Jobs\Process\Pool\Factory + neighborhoods.kojo.process.pool.factory: + class: Neighborhoods\Kojo\Process\Pool\Factory shared: false calls: - [setMaxChildProcesses, ['%process_pool_strategy.max_child_processes%']] @@ -23,9 +23,9 @@ services: - [setProcessPoolStrategy, ['@process.pool.strategy']] - [setProcessCollection, ['@process.collection']] process.pool.factory: - alias: nhds.jobs.process.pool.factory - nhds.jobs.process.pool.factory-server: - class: NHDS\Jobs\Process\Pool\Factory + alias: neighborhoods.kojo.process.pool.factory + neighborhoods.kojo.process.pool.factory-server: + class: Neighborhoods\Kojo\Process\Pool\Factory shared: false calls: - [setMaxChildProcesses, ['%process_pool_strategy-server.max_child_processes%']] @@ -35,9 +35,9 @@ services: - [setProcessPoolStrategy, ['@process.pool.strategy-server']] - [setProcessCollection, ['@process.collection-server']] process.pool.factory-server: - alias: nhds.jobs.process.pool.factory-server - nhds.jobs.process.pool.factory-job: - class: NHDS\Jobs\Process\Pool\Factory + alias: neighborhoods.kojo.process.pool.factory-server + neighborhoods.kojo.process.pool.factory-job: + class: Neighborhoods\Kojo\Process\Pool\Factory shared: false calls: - [setMaxChildProcesses, ['%process_pool_strategy-job.max_child_processes%']] @@ -47,9 +47,9 @@ services: - [setProcessPoolStrategy, ['@process.pool.strategy-job']] - [setProcessCollection, ['@process.collection-job']] process.pool.factory-job: - alias: nhds.jobs.process.pool.factory-job - nhds.jobs.process.pool.factory-empty: - class: NHDS\Jobs\Process\Pool\Factory + alias: neighborhoods.kojo.process.pool.factory-job + neighborhoods.kojo.process.pool.factory-empty: + class: Neighborhoods\Kojo\Process\Pool\Factory shared: false calls: - [setMaxChildProcesses, ['%process_pool_strategy-empty.max_child_processes%']] @@ -59,4 +59,4 @@ services: - [setProcessPoolStrategy, ['@process.pool.strategy-job']] - [setProcessCollection, ['@process.collection-empty']] process.pool.factory-empty: - alias: nhds.jobs.process.pool.factory-empty \ No newline at end of file + alias: neighborhoods.kojo.process.pool.factory-empty \ No newline at end of file diff --git a/src/config/Process/Pool/Logger.yml b/config/Process/Pool/Logger.yml similarity index 75% rename from src/config/Process/Pool/Logger.yml rename to config/Process/Pool/Logger.yml index 3908b873..4dbba75c 100644 --- a/src/config/Process/Pool/Logger.yml +++ b/config/Process/Pool/Logger.yml @@ -3,12 +3,12 @@ parameters: process.pool.logger.path_padding: 80 process.pool.logger.is_enabled: true services: - nhds.jobs.process.pool.logger: - class: NHDS\Jobs\Process\Pool\Logger + neighborhoods.kojo.process.pool.logger: + class: Neighborhoods\Kojo\Process\Pool\Logger calls: - [setIsEnabled, ['%process.pool.logger.is_enabled%']] - [setTime, ['@nhds.toolkit.time']] - [setProcessIdPadding, ['%process.pool.logger.process_id_padding%']] - [setProcessPathPadding, ['%process.pool.logger.path_padding%']] process.pool.logger: - alias: nhds.jobs.process.pool.logger \ No newline at end of file + alias: neighborhoods.kojo.process.pool.logger \ No newline at end of file diff --git a/src/config/Process/Pool/Server.yml b/config/Process/Pool/Server.yml similarity index 81% rename from src/config/Process/Pool/Server.yml rename to config/Process/Pool/Server.yml index 9c044766..e12bde95 100644 --- a/src/config/Process/Pool/Server.yml +++ b/config/Process/Pool/Server.yml @@ -1,7 +1,7 @@ services: - nhds.jobs.process.pool.server: + neighborhoods.kojo.process.pool.server: public: true - class: NHDS\Jobs\Process\Pool\Server + class: Neighborhoods\Kojo\Process\Pool\Server calls: - [setLogger, ['@process.pool.logger']] - [setSemaphore, ['@semaphore']] @@ -15,4 +15,4 @@ services: - [setTitlePrefix, ['%process.title.prefix%']] process.pool.server: public: true - alias: nhds.jobs.process.pool.server \ No newline at end of file + alias: neighborhoods.kojo.process.pool.server \ No newline at end of file diff --git a/src/config/Process/Pool/Strategy.yml b/config/Process/Pool/Strategy.yml similarity index 65% rename from src/config/Process/Pool/Strategy.yml rename to config/Process/Pool/Strategy.yml index 7286b0b6..87c6f545 100644 --- a/src/config/Process/Pool/Strategy.yml +++ b/config/Process/Pool/Strategy.yml @@ -3,30 +3,30 @@ parameters: process.pool.strategy-server.maximum_load_average: 10.0 process.pool.strategy-job.maximum_load_average: 10.0 services: - nhds.jobs.process.pool.strategy: + neighborhoods.kojo.process.pool.strategy: shared: false - class: NHDS\Jobs\Process\Pool\Strategy + class: Neighborhoods\Kojo\Process\Pool\Strategy calls: - [setAlarmProcessTypeCode, ['job']] - [setLogger, ['@process.pool.logger']] - [setMaximumLoadAverage, ['%process.pool.strategy.maximum_load_average%']] process.pool.strategy: - alias: nhds.jobs.process.pool.strategy - nhds.jobs.process.pool.strategy-server: + alias: neighborhoods.kojo.process.pool.strategy + neighborhoods.kojo.process.pool.strategy-server: shared: false - class: NHDS\Jobs\Process\Pool\Strategy + class: Neighborhoods\Kojo\Process\Pool\Strategy calls: - [setAlarmProcessTypeCode, ['root']] - [setFillProcessTypeCode, ['root']] - [setLogger, ['@process.pool.logger']] - [setMaximumLoadAverage, ['%process.pool.strategy-server.maximum_load_average%']] process.pool.strategy-server: - alias: nhds.jobs.process.pool.strategy-server - nhds.jobs.process.pool.strategy-job: + alias: neighborhoods.kojo.process.pool.strategy-server + neighborhoods.kojo.process.pool.strategy-job: shared: false - class: NHDS\Jobs\Process\Pool\Strategy + class: Neighborhoods\Kojo\Process\Pool\Strategy calls: - [setLogger, ['@process.pool.logger']] - [setMaximumLoadAverage, ['%process.pool.strategy-job.maximum_load_average%']] process.pool.strategy-job: - alias: nhds.jobs.process.pool.strategy-job \ No newline at end of file + alias: neighborhoods.kojo.process.pool.strategy-job \ No newline at end of file diff --git a/config/Process/Registry.yml b/config/Process/Registry.yml new file mode 100644 index 00000000..ec5be0dd --- /dev/null +++ b/config/Process/Registry.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.process.registry: + class: Neighborhoods\Kojo\Process\Registry + public: false + shared: true + process.registry: + alias: neighborhoods.kojo.process.registry + public: false \ No newline at end of file diff --git a/src/config/Process/Root.yml b/config/Process/Root.yml similarity index 79% rename from src/config/Process/Root.yml rename to config/Process/Root.yml index 15af96d2..4268cc0b 100644 --- a/src/config/Process/Root.yml +++ b/config/Process/Root.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.process.root: - class: NHDS\Jobs\Process\Root + neighborhoods.kojo.process.root: + class: Neighborhoods\Kojo\Process\Root calls: - [setProcessPoolFactory, ['@process.pool.factory']] - [setLogger, ['@process.pool.logger']] @@ -11,4 +11,4 @@ services: - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.root: - alias: nhds.jobs.process.root \ No newline at end of file + alias: neighborhoods.kojo.process.root \ No newline at end of file diff --git a/config/Process/Signal.yml b/config/Process/Signal.yml new file mode 100644 index 00000000..6120d209 --- /dev/null +++ b/config/Process/Signal.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.process.signal: + class: Neighborhoods\Kojo\Process\Signal + public: false + shared: true + process.signal: + alias: neighborhoods.kojo.process.signal + public: false \ No newline at end of file diff --git a/config/Process/Strategy/ProcessControl.yml b/config/Process/Strategy/ProcessControl.yml new file mode 100644 index 00000000..7e0c19ed --- /dev/null +++ b/config/Process/Strategy/ProcessControl.yml @@ -0,0 +1,5 @@ +services: + neighborhoods.kojo.process.strategy.process_control: + class: Neighborhoods\Kojo\Process\Strategy\ProcessControl + process.strategy.process_control: + alias: neighborhoods.kojo.process.strategy.process_control \ No newline at end of file diff --git a/src/config/Redis.yml b/config/Redis.yml similarity index 100% rename from src/config/Redis.yml rename to config/Redis.yml diff --git a/src/config/Redis/Factory.yml b/config/Redis/Factory.yml similarity index 65% rename from src/config/Redis/Factory.yml rename to config/Redis/Factory.yml index 30467e5c..93c8455f 100644 --- a/src/config/Redis/Factory.yml +++ b/config/Redis/Factory.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.redis.factory: - class: NHDS\Jobs\Redis\Factory + neighborhoods.kojo.redis.factory: + class: Neighborhoods\Kojo\Redis\Factory public: false shared: true calls: @@ -8,5 +8,5 @@ services: - [setHost, ['%env(REDIS_HOST)%']] - [setPort, ['%env(REDIS_PORT)%']] redis.factory: - alias: nhds.jobs.redis.factory + alias: neighborhoods.kojo.redis.factory public: false \ No newline at end of file diff --git a/src/config/Redis/Repository.yml b/config/Redis/Repository.yml similarity index 58% rename from src/config/Redis/Repository.yml rename to config/Redis/Repository.yml index 3a35a3e7..673e3985 100644 --- a/src/config/Redis/Repository.yml +++ b/config/Redis/Repository.yml @@ -1,11 +1,11 @@ services: - nhds.jobs.redis.repository: - class: NHDS\Jobs\Redis\Repository + neighborhoods.kojo.redis.repository: + class: Neighborhoods\Kojo\Redis\Repository public: false shared: true calls: - [setProcessRegistry, ['@process.registry']] - [setRedisFactory, ['@redis.factory']] redis.repository: - alias: nhds.jobs.redis.repository + alias: neighborhoods.kojo.redis.repository public: false \ No newline at end of file diff --git a/src/config/Scheduler.yml b/config/Scheduler.yml similarity index 80% rename from src/config/Scheduler.yml rename to config/Scheduler.yml index fdb6cd93..37519813 100644 --- a/src/config/Scheduler.yml +++ b/config/Scheduler.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.scheduler: - class: NHDS\Jobs\Scheduler + neighborhoods.kojo.scheduler: + class: Neighborhoods\Kojo\Scheduler shared: false public: false calls: @@ -11,5 +11,5 @@ services: - [addSemaphoreResourceFactory, ['@semaphore.resource.factory-schedule']] - [setSchedulerCache, ['@scheduler.cache']] scheduler: - alias: nhds.jobs.scheduler + alias: neighborhoods.kojo.scheduler public: false \ No newline at end of file diff --git a/src/config/Scheduler/Cache.yml b/config/Scheduler/Cache.yml similarity index 62% rename from src/config/Scheduler/Cache.yml rename to config/Scheduler/Cache.yml index c4ce3c83..d6d8c61c 100644 --- a/src/config/Scheduler/Cache.yml +++ b/config/Scheduler/Cache.yml @@ -1,10 +1,10 @@ services: - nhds.jobs.scheduler.cache: - class: NHDS\Jobs\Scheduler\Cache + neighborhoods.kojo.scheduler.cache: + class: Neighborhoods\Kojo\Scheduler\Cache shared: true calls: - [setSchedulerTime, ['@scheduler.time']] - [setCacheItemPoolRepository, ['@cache_item_pool.repository']] - [setTime, ['@nhds.toolkit.time']] scheduler.cache: - alias: nhds.jobs.scheduler.cache \ No newline at end of file + alias: neighborhoods.kojo.scheduler.cache \ No newline at end of file diff --git a/src/config/Scheduler/Time.yml b/config/Scheduler/Time.yml similarity index 52% rename from src/config/Scheduler/Time.yml rename to config/Scheduler/Time.yml index d8290c4c..13e94154 100644 --- a/src/config/Scheduler/Time.yml +++ b/config/Scheduler/Time.yml @@ -1,9 +1,9 @@ services: - nhds.jobs.scheduler.time: - class: NHDS\Jobs\Scheduler\Time + neighborhoods.kojo.scheduler.time: + class: Neighborhoods\Kojo\Scheduler\Time shared: true calls: - [setMinutesToScheduleAheadFor, [5]] - [setTime, ['@nhds.toolkit.time']] scheduler.time: - alias: nhds.jobs.scheduler.time \ No newline at end of file + alias: neighborhoods.kojo.scheduler.time \ No newline at end of file diff --git a/src/config/Selector.yml b/config/Selector.yml similarity index 81% rename from src/config/Selector.yml rename to config/Selector.yml index 538a1b9e..1ce59e5c 100644 --- a/src/config/Selector.yml +++ b/config/Selector.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.selector: - class: NHDS\Jobs\Selector + neighborhoods.kojo.selector: + class: Neighborhoods\Kojo\Selector public: false shared: true calls: @@ -14,5 +14,5 @@ services: - [setStateService, ['@state.service']] - [setRandomIntMax, [10]] selector: - alias: nhds.jobs.selector + alias: neighborhoods.kojo.selector public: false \ No newline at end of file diff --git a/config/Semaphore.yml b/config/Semaphore.yml new file mode 100644 index 00000000..93df1945 --- /dev/null +++ b/config/Semaphore.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.semaphore: + class: Neighborhoods\Kojo\Semaphore + public: false + shared: true + semaphore: + alias: neighborhoods.kojo.semaphore + public: false \ No newline at end of file diff --git a/src/config/Semaphore/Mutex/Flock.yml b/config/Semaphore/Mutex/Flock.yml similarity index 59% rename from src/config/Semaphore/Mutex/Flock.yml rename to config/Semaphore/Mutex/Flock.yml index e9c99ec8..f8d13655 100644 --- a/src/config/Semaphore/Mutex/Flock.yml +++ b/config/Semaphore/Mutex/Flock.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.semaphore.mutex.flock: - class: NHDS\Jobs\Semaphore\Mutex\Flock + neighborhoods.kojo.semaphore.mutex.flock: + class: Neighborhoods\Kojo\Semaphore\Mutex\Flock shared: false calls: - [setFileMode, ['c']] @@ -8,4 +8,4 @@ services: - [setDirectoryPathPrefix, ['/tmp/']] - [setLogger, ['@process.pool.logger']] semaphore.mutex.flock: - alias: nhds.jobs.semaphore.mutex.flock \ No newline at end of file + alias: neighborhoods.kojo.semaphore.mutex.flock \ No newline at end of file diff --git a/src/config/Semaphore/Mutex/Redis.yml b/config/Semaphore/Mutex/Redis.yml similarity index 62% rename from src/config/Semaphore/Mutex/Redis.yml rename to config/Semaphore/Mutex/Redis.yml index f3fb60d5..790bb6ee 100644 --- a/src/config/Semaphore/Mutex/Redis.yml +++ b/config/Semaphore/Mutex/Redis.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.semaphore.mutex.redis: - class: NHDS\Jobs\Semaphore\Mutex\Redis + neighborhoods.kojo.semaphore.mutex.redis: + class: Neighborhoods\Kojo\Semaphore\Mutex\Redis shared: false public: false calls: @@ -8,5 +8,5 @@ services: - [setRedisRepository, ['@redis.repository']] - [setProcessRegistry, ['@process.registry']] semaphore.mutex.redis: - alias: nhds.jobs.semaphore.mutex.redis + alias: neighborhoods.kojo.semaphore.mutex.redis public: false \ No newline at end of file diff --git a/config/Semaphore/Resource.yml b/config/Semaphore/Resource.yml new file mode 100644 index 00000000..37987ad9 --- /dev/null +++ b/config/Semaphore/Resource.yml @@ -0,0 +1,53 @@ +services: + neighborhoods.kojo.semaphore.resource-job: + class: Neighborhoods\Kojo\Semaphore\Resource + shared: false + calls: + - [setIsBlocking, [false]] + semaphore.resource-job: + alias: neighborhoods.kojo.semaphore.resource-job + neighborhoods.kojo.semaphore.resource-maintainer_delete: + class: Neighborhoods\Kojo\Semaphore\Resource + shared: false + calls: + - [setResourceName, ['maintainer_delete.lock']] + - [setResourcePath, ['neighborhoods/kojo']] + - [setIsBlocking, [false]] + semaphore.resource-maintainer_delete: + alias: neighborhoods.kojo.semaphore.resource-maintainer_delete + neighborhoods.kojo.semaphore.resource-update_pending_jobs: + class: Neighborhoods\Kojo\Semaphore\Resource + shared: false + calls: + - [setResourceName, ['update_pending_jobs.lock']] + - [setResourcePath, ['neighborhoods/kojo']] + - [setIsBlocking, [false]] + semaphore.resource-update_pending_jobs: + alias: neighborhoods.kojo.semaphore.resource-update_pending_jobs + neighborhoods.kojo.semaphore.resource-reschedule_jobs: + class: Neighborhoods\Kojo\Semaphore\Resource + shared: false + calls: + - [setResourceName, ['reschedule_jobs.lock']] + - [setResourcePath, ['neighborhoods/kojo']] + - [setIsBlocking, [false]] + semaphore.resource-reschedule_jobs: + alias: neighborhoods.kojo.semaphore.resource-reschedule_jobs + neighborhoods.kojo.semaphore.resource-schedule: + class: Neighborhoods\Kojo\Semaphore\Resource + calls: + - [setResourceName, ['schedule.lock']] + - [setResourcePath, ['neighborhoods/kojo']] + - [setIsBlocking, [false]] + shared: false + semaphore.resource-schedule: + alias: neighborhoods.kojo.semaphore.resource-schedule + neighborhoods.kojo.semaphore.resource-server: + class: Neighborhoods\Kojo\Semaphore\Resource + shared: false + calls: + - [setResourceName, ['server.lock']] + - [setResourcePath, ['neighborhoods/kojo']] + - [setIsBlocking, [false]] + semaphore.resource-server: + alias: neighborhoods.kojo.semaphore.resource-server \ No newline at end of file diff --git a/src/config/Semaphore/Resource/Factory.yml b/config/Semaphore/Resource/Factory.yml similarity index 57% rename from src/config/Semaphore/Resource/Factory.yml rename to config/Semaphore/Resource/Factory.yml index c5a907ae..cc76c41d 100644 --- a/src/config/Semaphore/Resource/Factory.yml +++ b/config/Semaphore/Resource/Factory.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.semaphore.resource.factory-job: - class: NHDS\Jobs\Semaphore\Resource\Factory + neighborhoods.kojo.semaphore.resource.factory-job: + class: Neighborhoods\Kojo\Semaphore\Resource\Factory calls: - [setName, ['job']] - [setSemaphoreResource, ['@semaphore.resource-job']] @@ -8,49 +8,49 @@ services: - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-job: - alias: nhds.jobs.semaphore.resource.factory-job - nhds.jobs.semaphore.resource.factory-maintainer_delete: - class: NHDS\Jobs\Semaphore\Resource\Factory + alias: neighborhoods.kojo.semaphore.resource.factory-job + neighborhoods.kojo.semaphore.resource.factory-maintainer_delete: + class: Neighborhoods\Kojo\Semaphore\Resource\Factory calls: - [setName, ['maintainer_delete']] - [setSemaphoreResource, ['@semaphore.resource-maintainer_delete']] - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-maintainer_delete: - alias: nhds.jobs.semaphore.resource.factory-maintainer_delete - nhds.jobs.semaphore.resource.factory-update_pending_jobs: - class: NHDS\Jobs\Semaphore\Resource\Factory + alias: neighborhoods.kojo.semaphore.resource.factory-maintainer_delete + neighborhoods.kojo.semaphore.resource.factory-update_pending_jobs: + class: Neighborhoods\Kojo\Semaphore\Resource\Factory calls: - [setName, ['update_pending_jobs']] - [setSemaphoreResource, ['@semaphore.resource-update_pending_jobs']] - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-update_pending_jobs: - alias: nhds.jobs.semaphore.resource.factory-update_pending_jobs - nhds.jobs.semaphore.resource.factory-reschedule_jobs: - class: NHDS\Jobs\Semaphore\Resource\Factory + alias: neighborhoods.kojo.semaphore.resource.factory-update_pending_jobs + neighborhoods.kojo.semaphore.resource.factory-reschedule_jobs: + class: Neighborhoods\Kojo\Semaphore\Resource\Factory calls: - [setName, ['reschedule_jobs']] - [setSemaphoreResource, ['@semaphore.resource-reschedule_jobs']] - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-reschedule_jobs: - alias: nhds.jobs.semaphore.resource.factory-reschedule_jobs - nhds.jobs.semaphore.resource.factory-schedule: - class: NHDS\Jobs\Semaphore\Resource\Factory + alias: neighborhoods.kojo.semaphore.resource.factory-reschedule_jobs + neighborhoods.kojo.semaphore.resource.factory-schedule: + class: Neighborhoods\Kojo\Semaphore\Resource\Factory calls: - [setName, ['schedule']] - [setSemaphoreResource, ['@semaphore.resource-schedule']] - [setMutex, ['@semaphore.mutex.redis']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-schedule: - alias: nhds.jobs.semaphore.resource.factory-schedule - nhds.jobs.semaphore.resource.factory-server: - class: NHDS\Jobs\Semaphore\Resource\Factory + alias: neighborhoods.kojo.semaphore.resource.factory-schedule + neighborhoods.kojo.semaphore.resource.factory-server: + class: Neighborhoods\Kojo\Semaphore\Resource\Factory calls: - [setName, ['server']] - [setSemaphoreResource, ['@semaphore.resource-server']] - [setMutex, ['@semaphore.mutex.flock']] - [setSemaphore, ['@semaphore']] semaphore.resource.factory-server: - alias: nhds.jobs.semaphore.resource.factory-server \ No newline at end of file + alias: neighborhoods.kojo.semaphore.resource.factory-server \ No newline at end of file diff --git a/config/Semaphore/Resource/Owner/Job.yml b/config/Semaphore/Resource/Owner/Job.yml new file mode 100644 index 00000000..4bd19b12 --- /dev/null +++ b/config/Semaphore/Resource/Owner/Job.yml @@ -0,0 +1,5 @@ +services: + neighborhoods.kojo.semaphore.resource.owner.job: + class: Neighborhoods\Kojo\Semaphore\Resource\Owner\Job + semaphore.resource.owner.job: + alias: neighborhoods.kojo.semaphore.resource.owner.job \ No newline at end of file diff --git a/src/config/Service/Create.yml b/config/Service/Create.yml similarity index 54% rename from src/config/Service/Create.yml rename to config/Service/Create.yml index 7d2d1b96..75d72030 100644 --- a/src/config/Service/Create.yml +++ b/config/Service/Create.yml @@ -1,9 +1,9 @@ services: - nhds.jobs.service.create: - class: NHDS\Jobs\Service\Create + neighborhoods.kojo.service.create: + class: Neighborhoods\Kojo\Service\Create shared: false calls: - [setTypeRepository, ['@type.repository']] - [setTime, ['@nhds.toolkit.time']] service.create: - alias: nhds.jobs.service.create \ No newline at end of file + alias: neighborhoods.kojo.service.create \ No newline at end of file diff --git a/src/config/Service/Create/Factory.yml b/config/Service/Create/Factory.yml similarity index 66% rename from src/config/Service/Create/Factory.yml rename to config/Service/Create/Factory.yml index a03861e8..9fcd1676 100644 --- a/src/config/Service/Create/Factory.yml +++ b/config/Service/Create/Factory.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.service.create.factory: - class: NHDS\Jobs\Service\Create\Factory + neighborhoods.kojo.service.create.factory: + class: Neighborhoods\Kojo\Service\Create\Factory calls: - [setStateService, ['@state.service']] - [setServiceCreate, ['@service.create']] @@ -8,4 +8,4 @@ services: - [setJobType, ['@data.job.type']] - [setJob, ['@data.job']] service.create.factory: - alias: nhds.jobs.service.create.factory \ No newline at end of file + alias: neighborhoods.kojo.service.create.factory \ No newline at end of file diff --git a/config/Service/Update/Complete/Failed.yml b/config/Service/Update/Complete/Failed.yml new file mode 100644 index 00000000..a20c77d7 --- /dev/null +++ b/config/Service/Update/Complete/Failed.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.complete.failed: + class: Neighborhoods\Kojo\Service\Update\Complete\Failed + shared: false + service.update.complete.failed: + alias: neighborhoods.kojo.service.update.complete.failed \ No newline at end of file diff --git a/config/Service/Update/Complete/Failed/Factory.yml b/config/Service/Update/Complete/Failed/Factory.yml new file mode 100644 index 00000000..33ebc5f4 --- /dev/null +++ b/config/Service/Update/Complete/Failed/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.complete.failed.factory: + class: Neighborhoods\Kojo\Service\Update\Complete\Failed\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateCompleteFailed, ['@service.update.complete.failed']] + service.update.complete.failed.factory: + alias: neighborhoods.kojo.service.update.complete.failed.factory \ No newline at end of file diff --git a/config/Service/Update/Complete/FailedScheduleLimitCheck.yml b/config/Service/Update/Complete/FailedScheduleLimitCheck.yml new file mode 100644 index 00000000..a6273093 --- /dev/null +++ b/config/Service/Update/Complete/FailedScheduleLimitCheck.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.complete.failedschedulelimitcheck: + class: Neighborhoods\Kojo\Service\Update\Complete\FailedScheduleLimitCheck + shared: false + service.update.complete.failedschedulelimitcheck: + alias: neighborhoods.kojo.service.update.complete.failedschedulelimitcheck \ No newline at end of file diff --git a/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml b/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml new file mode 100644 index 00000000..a3d86716 --- /dev/null +++ b/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.complete.failedschedulelimitcheck.factory: + class: Neighborhoods\Kojo\Service\Update\Complete\FailedScheduleLimitCheck\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateCompleteFailedScheduleLimitCheck, ['@service.update.complete.failedschedulelimitcheck']] + service.update.complete.failedschedulelimitcheck.factory: + alias: neighborhoods.kojo.service.update.complete.failedschedulelimitcheck.factory \ No newline at end of file diff --git a/config/Service/Update/Complete/Success.yml b/config/Service/Update/Complete/Success.yml new file mode 100644 index 00000000..72476192 --- /dev/null +++ b/config/Service/Update/Complete/Success.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.complete.success: + class: Neighborhoods\Kojo\Service\Update\Complete\Success + shared: false + service.update.complete.success: + alias: neighborhoods.kojo.service.update.complete.success \ No newline at end of file diff --git a/config/Service/Update/Complete/Success/Factory.yml b/config/Service/Update/Complete/Success/Factory.yml new file mode 100644 index 00000000..7a8c028d --- /dev/null +++ b/config/Service/Update/Complete/Success/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.complete.success.factory: + class: Neighborhoods\Kojo\Service\Update\Complete\Success\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateCompleteSuccess, ['@service.update.complete.success']] + service.update.complete.success.factory: + alias: neighborhoods.kojo.service.update.complete.success.factory \ No newline at end of file diff --git a/config/Service/Update/Crash.yml b/config/Service/Update/Crash.yml new file mode 100644 index 00000000..fe3a7983 --- /dev/null +++ b/config/Service/Update/Crash.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.crash: + class: Neighborhoods\Kojo\Service\Update\Crash + shared: false + service.update.crash: + alias: neighborhoods.kojo.service.update.crash \ No newline at end of file diff --git a/config/Service/Update/Crash/Factory.yml b/config/Service/Update/Crash/Factory.yml new file mode 100644 index 00000000..9d68db79 --- /dev/null +++ b/config/Service/Update/Crash/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.crash.factory: + class: Neighborhoods\Kojo\Service\Update\Crash\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateCrash, ['@service.update.crash']] + service.update.crash.factory: + alias: neighborhoods.kojo.service.update.crash.factory \ No newline at end of file diff --git a/config/Service/Update/Hold.yml b/config/Service/Update/Hold.yml new file mode 100644 index 00000000..5c8392f0 --- /dev/null +++ b/config/Service/Update/Hold.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.hold: + class: Neighborhoods\Kojo\Service\Update\Hold + shared: false + service.update.hold: + alias: neighborhoods.kojo.service.update.hold \ No newline at end of file diff --git a/config/Service/Update/Hold/Factory.yml b/config/Service/Update/Hold/Factory.yml new file mode 100644 index 00000000..d676f79d --- /dev/null +++ b/config/Service/Update/Hold/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.hold.factory: + class: Neighborhoods\Kojo\Service\Update\Hold\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateHold, ['@service.update.hold']] + service.update.hold.factory: + alias: neighborhoods.kojo.service.update.hold.factory \ No newline at end of file diff --git a/config/Service/Update/Panic.yml b/config/Service/Update/Panic.yml new file mode 100644 index 00000000..c6595b9c --- /dev/null +++ b/config/Service/Update/Panic.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.panic: + class: Neighborhoods\Kojo\Service\Update\Panic + shared: false + service.update.panic: + alias: neighborhoods.kojo.service.update.panic \ No newline at end of file diff --git a/config/Service/Update/Panic/Factory.yml b/config/Service/Update/Panic/Factory.yml new file mode 100644 index 00000000..3a8189a2 --- /dev/null +++ b/config/Service/Update/Panic/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.panic.factory: + class: Neighborhoods\Kojo\Service\Update\Panic\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdatePanic, ['@service.update.panic']] + service.update.panic.factory: + alias: neighborhoods.kojo.service.update.panic.factory \ No newline at end of file diff --git a/config/Service/Update/Retry.yml b/config/Service/Update/Retry.yml new file mode 100644 index 00000000..1716ca1d --- /dev/null +++ b/config/Service/Update/Retry.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.retry: + class: Neighborhoods\Kojo\Service\Update\Retry + shared: false + service.update.retry: + alias: neighborhoods.kojo.service.update.retry \ No newline at end of file diff --git a/config/Service/Update/Retry/Factory.yml b/config/Service/Update/Retry/Factory.yml new file mode 100644 index 00000000..2cf08efc --- /dev/null +++ b/config/Service/Update/Retry/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.retry.factory: + class: Neighborhoods\Kojo\Service\Update\Retry\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateRetry, ['@service.update.retry']] + service.update.retry.factory: + alias: neighborhoods.kojo.service.update.retry.factory \ No newline at end of file diff --git a/config/Service/Update/Wait.yml b/config/Service/Update/Wait.yml new file mode 100644 index 00000000..694bc874 --- /dev/null +++ b/config/Service/Update/Wait.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.wait: + class: Neighborhoods\Kojo\Service\Update\Wait + shared: false + service.update.wait: + alias: neighborhoods.kojo.service.update.wait \ No newline at end of file diff --git a/config/Service/Update/Wait/Factory.yml b/config/Service/Update/Wait/Factory.yml new file mode 100644 index 00000000..a21ba0db --- /dev/null +++ b/config/Service/Update/Wait/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.wait.factory: + class: Neighborhoods\Kojo\Service\Update\Wait\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateWait, ['@service.update.wait']] + service.update.wait.factory: + alias: neighborhoods.kojo.service.update.wait.factory \ No newline at end of file diff --git a/config/Service/Update/Work.yml b/config/Service/Update/Work.yml new file mode 100644 index 00000000..261c9e02 --- /dev/null +++ b/config/Service/Update/Work.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.service.update.work: + class: Neighborhoods\Kojo\Service\Update\Work + shared: false + service.update.work: + alias: neighborhoods.kojo.service.update.work \ No newline at end of file diff --git a/config/Service/Update/Work/Factory.yml b/config/Service/Update/Work/Factory.yml new file mode 100644 index 00000000..e85d1742 --- /dev/null +++ b/config/Service/Update/Work/Factory.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.service.update.work.factory: + class: Neighborhoods\Kojo\Service\Update\Work\Factory + calls: + - [setStateService, ['@state.service']] + - [setServiceUpdateWork, ['@service.update.work']] + service.update.work.factory: + alias: neighborhoods.kojo.service.update.work.factory \ No newline at end of file diff --git a/src/config/State/Service.yml b/config/State/Service.yml similarity index 54% rename from src/config/State/Service.yml rename to config/State/Service.yml index 3157e56a..a4765369 100644 --- a/src/config/State/Service.yml +++ b/config/State/Service.yml @@ -1,9 +1,9 @@ services: - nhds.jobs.state.service: - class: NHDS\Jobs\State\Service + neighborhoods.kojo.state.service: + class: Neighborhoods\Kojo\State\Service shared: false calls: - [setTime, ['@nhds.toolkit.time']] - [setTypeRepository, ['@type.repository']] state.service: - alias: nhds.jobs.state.service \ No newline at end of file + alias: neighborhoods.kojo.state.service \ No newline at end of file diff --git a/config/Type/Repository.yml b/config/Type/Repository.yml new file mode 100644 index 00000000..6dc12e47 --- /dev/null +++ b/config/Type/Repository.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.type.repository: + class: Neighborhoods\Kojo\Type\Repository + calls: + - [setJobType, ['@data.job.type']] + type.repository: + alias: neighborhoods.kojo.type.repository \ No newline at end of file diff --git a/config/Type/Service/Create.yml b/config/Type/Service/Create.yml new file mode 100644 index 00000000..03ca43af --- /dev/null +++ b/config/Type/Service/Create.yml @@ -0,0 +1,7 @@ +services: + neighborhoods.kojo.type.service.create: + class: Neighborhoods\Kojo\Type\Service\Create + calls: + - [setJobType, ['@data.job.type']] + type.service.create: + alias: neighborhoods.kojo.type.service.create \ No newline at end of file diff --git a/config/Worker/Bootstrap.yml b/config/Worker/Bootstrap.yml new file mode 100644 index 00000000..0b484a83 --- /dev/null +++ b/config/Worker/Bootstrap.yml @@ -0,0 +1,5 @@ +services: + neighborhoods.kojo.worker.bootstrap: + class: Neighborhoods\Kojo\Worker\Bootstrap + worker.bootstrap: + alias: neighborhoods.kojo.worker.bootstrap \ No newline at end of file diff --git a/src/config/Worker/Job/Service.yml b/config/Worker/Job/Service.yml similarity index 76% rename from src/config/Worker/Job/Service.yml rename to config/Worker/Job/Service.yml index a6d6dd1d..ab19db67 100644 --- a/src/config/Worker/Job/Service.yml +++ b/config/Worker/Job/Service.yml @@ -1,6 +1,6 @@ services: - nhds.jobs.worker.job.service: - class: NHDS\Jobs\Worker\Job\Service + neighborhoods.kojo.worker.job.service: + class: Neighborhoods\Kojo\Worker\Job\Service shared: false calls: - [setServiceCreateFactory, ['@service.create.factory']] @@ -9,4 +9,4 @@ services: - [setServiceUpdateHoldFactory, ['@service.update.hold.factory']] - [setServiceUpdateRetryFactory, ['@service.update.retry.factory']] worker.job.service: - alias: nhds.jobs.worker.job.service \ No newline at end of file + alias: neighborhoods.kojo.worker.job.service \ No newline at end of file diff --git a/config/Worker/Locator.yml b/config/Worker/Locator.yml new file mode 100644 index 00000000..0f1159dc --- /dev/null +++ b/config/Worker/Locator.yml @@ -0,0 +1,6 @@ +services: + neighborhoods.kojo.worker.locator: + class: Neighborhoods\Kojo\Worker\Locator + shared: false + worker.locator: + alias: neighborhoods.kojo.worker.locator \ No newline at end of file diff --git a/src/config/dependencies.yml b/config/dependencies.yml similarity index 82% rename from src/config/dependencies.yml rename to config/dependencies.yml index 614ed5c9..282fac75 100644 --- a/src/config/dependencies.yml +++ b/config/dependencies.yml @@ -1,9 +1,9 @@ services: nhds.toolkit.time: - class: NHDS\Toolkit\Time + class: Neighborhoods\Toolkit\Time symfony.component.expressionlanguage.expressionlanguage: class: \Symfony\Component\ExpressionLanguage\ExpressionLanguage - nhds.jobs.symfony.component.console.application: + nhds.kojo.symfony.component.console.application: public: true class: Symfony\Component\Console\Application calls: diff --git a/src/config/root.yml b/config/root.yml similarity index 100% rename from src/config/root.yml rename to config/root.yml diff --git a/example/Worker.php b/example/Worker.php index 5a480b17..3ab235a9 100644 --- a/example/Worker.php +++ b/example/Worker.php @@ -1,7 +1,7 @@ _getDbConnectionContainer(ContainerInterface::NAME_JOB)->setPdo($pdo); $this->_getDbConnectionContainer(ContainerInterface::NAME_SCHEMA)->setPdo($pdo); diff --git a/example/config/root.yml b/example/config/root.yml index a926dacc..8a50047b 100644 --- a/example/config/root.yml +++ b/example/config/root.yml @@ -1,16 +1,16 @@ services: - nhds.jobs.db.connection.container-schema: - class: NHDS\Jobs\Db\Connection\Container + neighborhoods.kojo.db.connection.container-schema: + class: Neighborhoods\Kojo\Db\Connection\Container calls: - - [setName, ["@=constant('NHDS\\\\Jobs\\\\Db\\\\Connection\\\\ContainerInterface::NAME_SCHEMA')"]] - nhds.jobs.db.connection.container-job: - class: NHDS\Jobs\Db\Connection\Container + - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_SCHEMA]] + neighborhoods.kojo.db.connection.container-job: + class: Neighborhoods\Kojo\Db\Connection\Container calls: - - [setName, ["@=constant('NHDS\\\\Jobs\\\\Db\\\\Connection\\\\ContainerInterface::NAME_JOB')"]] - nhds.jobs.example.worker.bootstrap: - class: NHDS\Jobs\Example\Worker\Bootstrap + - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_JOB]] + neighborhoods.kojo.example.worker.bootstrap: + class: Neighborhoods\Kojo\Example\Worker\Bootstrap calls: - - [addDbConnectionContainer, ['@nhds.jobs.db.connection.container-job']] - - [addDbConnectionContainer, ['@nhds.jobs.db.connection.container-schema']] + - [addDbConnectionContainer, ['@neighborhoods.kojo.db.connection.container-job']] + - [addDbConnectionContainer, ['@neighborhoods.kojo.db.connection.container-schema']] worker.bootstrap: - alias: nhds.jobs.example.worker.bootstrap \ No newline at end of file + alias: neighborhoods.kojo.example.worker.bootstrap \ No newline at end of file diff --git a/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php b/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php index a6d69d24..31b33124 100644 --- a/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php +++ b/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php @@ -1,7 +1,7 @@ setName('db:setup:install'); - $this->setDescription('Installs Jobs to a persistent storage engine.'); + $this->setDescription('Installs Kojo to a persistent storage engine.'); $this->setHelp($this->_getHelp()); return $this; @@ -25,6 +25,7 @@ public function _execute(): CommandAbstract { $this->_getBootstrap()->instantiate(); $this->_getDbSetup()->install(); + $this->_getOutput()->writeln('Kojo has been successfully installed.'); return $this; } @@ -32,7 +33,7 @@ public function _execute(): CommandAbstract protected function _getHelp(): string { return <<<'EOD' -This command installs a Jobs cluster on a persistent storage engine. +This command installs a Kojo cluster on a persistent storage engine. Currently only \PDO compatible storage engines are supported. The client's Bootstrap class will be called prior to setup, and that \PDO class will be used for setup. EOD; diff --git a/src/Console/Command/Db/TearDown/Uninstall.php b/src/Console/Command/Db/TearDown/Uninstall.php index 6ece5d66..ccd734ac 100644 --- a/src/Console/Command/Db/TearDown/Uninstall.php +++ b/src/Console/Command/Db/TearDown/Uninstall.php @@ -1,11 +1,11 @@ _getInput()->getArgument(self::ARG_SERVICES_YML_FILE_PATH)]; + $arguments = [self::OPT_RUN_SERVER]; + $arguments[] = 'ysfp:' . $this->_getInput()->getArgument(self::ARG_SERVICES_YML_FILE_PATH); foreach ($this->_getInput()->getOption(self::OPT_SERVICES_YML_FILE_PATH) as $servicesYmlFilePath) { $arguments[] = 'ysfp:' . $servicesYmlFilePath; } - pcntl_exec(__DIR__ . '/../../../../../bin/server', $arguments); + pcntl_exec(__DIR__ . '/../../../../../../bin/kojo', $arguments); $this->_getOutput()->writeln('An error occurred trying to start the process pool server.'); return $this; diff --git a/src/Console/CommandAbstract.php b/src/Console/CommandAbstract.php index 5632e9b6..d414920a 100644 --- a/src/Console/CommandAbstract.php +++ b/src/Console/CommandAbstract.php @@ -1,12 +1,12 @@ _getOutput()->writeln( [ - 'NHDS Jobs - A distributed task manager.', - '=======================================', + 'Neighborhoods Kōjō', + '===========================', + 'A distributed task manager.', '', ] ); diff --git a/src/Data/AutoSchedule/Sqs.php b/src/Data/AutoSchedule/Sqs.php index ae8f0fcc..23ab9cff 100644 --- a/src/Data/AutoSchedule/Sqs.php +++ b/src/Data/AutoSchedule/Sqs.php @@ -1,10 +1,10 @@ addColumn( new Varchar( 'version', 255, true, null, [ - 'comment' => 'The schema version for jobs.', + 'comment' => 'The schema version for Kojo.', ])); $this->_setSchemaChanges($createTable); diff --git a/src/Db/Setup/Schema/Version_1_0_0.php b/src/Db/Setup/Schema/Version_1_0_0.php index a7a9da8c..9b640f58 100644 --- a/src/Db/Setup/Schema/Version_1_0_0.php +++ b/src/Db/Setup/Schema/Version_1_0_0.php @@ -1,11 +1,11 @@ _setSchemaChanges($dropTable); return $this; diff --git a/src/Db/TearDown/Schema/Version_1_0_0.php b/src/Db/TearDown/Schema/Version_1_0_0.php index 8dc457c6..f669811b 100644 --- a/src/Db/TearDown/Schema/Version_1_0_0.php +++ b/src/Db/TearDown/Schema/Version_1_0_0.php @@ -1,11 +1,11 @@ getMessage(); - exit(1); -} -$serviceContainer = new \NHDS\Jobs\Service\Container(); -$ymlServiceFilePath = __DIR__ . '/../config/root.yml'; -$serviceContainer->addServicesYmlFilePath($ymlServiceFilePath); -if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { - $serviceContainer->addServicesYmlFilePath($argv[2]); -} -$consoleApplication = $serviceContainer->getContainerBuilder()->get('nhds.jobs.symfony.component.console.application'); - -$consoleApplication->run(); \ No newline at end of file diff --git a/src/bin/server b/src/bin/server deleted file mode 100755 index b272b979..00000000 --- a/src/bin/server +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env php -getMessage(); - exit(1); -} -$serviceContainer = new \NHDS\Jobs\Service\Container(); -$ymlServiceFilePath = __DIR__ . '/../config/root.yml'; -$serviceContainer->addServicesYmlFilePath($ymlServiceFilePath); -foreach ($argv as $argument) { - if (strstr($argument, 'ysfp:') !== false) { - $ymlServicesFilePath = explode('ysfp:', $argument); - $serviceContainer->addServicesYmlFilePath($ymlServicesFilePath[1]); - } -} -$server = $serviceContainer->getContainerBuilder()->get('process.pool.server'); -$server->setParentProcessPath(''); -$server->start(); \ No newline at end of file diff --git a/src/config/Console/Command/Db/Setup/Install.yml b/src/config/Console/Command/Db/Setup/Install.yml deleted file mode 100644 index 53b050a4..00000000 --- a/src/config/Console/Command/Db/Setup/Install.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.console.command.db.setup.install: - class: NHDS\Jobs\Console\Command\Db\Setup\Install - calls: - - [setBootstrap, ['@worker.bootstrap']] - - [setDbSetup, ['@db.setup']] - console.command.db.setup.install: - alias: nhds.jobs.console.command.db.setup.install \ No newline at end of file diff --git a/src/config/Console/Command/Db/TearDown/Uninstall.yml b/src/config/Console/Command/Db/TearDown/Uninstall.yml deleted file mode 100644 index 4dc13a4b..00000000 --- a/src/config/Console/Command/Db/TearDown/Uninstall.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.console.command.db.tear_down.uninstall: - class: NHDS\Jobs\Console\Command\Db\TearDown\Uninstall - calls: - - [setBootstrap, ['@worker.bootstrap']] - - [setDbTearDown, ['@db.tear_down']] - console.command.db.tear_down.uninstall: - alias: nhds.jobs.console.command.db.tear_down.uninstall \ No newline at end of file diff --git a/src/config/Console/Command/Process/Pool/Server/Start.yml b/src/config/Console/Command/Process/Pool/Server/Start.yml deleted file mode 100644 index c8117aa7..00000000 --- a/src/config/Console/Command/Process/Pool/Server/Start.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - nhds.jobs.console.command.process.pool.server.start: - class: NHDS\Jobs\Console\Command\Process\Pool\Server\Start - console.command.process.pool.server.start: - alias: nhds.jobs.console.command.process.pool.server.start \ No newline at end of file diff --git a/src/config/Data/Job/Collection/Iterator.yml b/src/config/Data/Job/Collection/Iterator.yml deleted file mode 100644 index a22ca939..00000000 --- a/src/config/Data/Job/Collection/Iterator.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.data.job.collection.iterator: - class: NHDS\Jobs\Data\Job\Collection\Iterator - shared: false - data.job.collection.iterator: - alias: nhds.jobs.data.job.collection.iterator \ No newline at end of file diff --git a/src/config/Data/Job/Type/Collection/Iterator.yml b/src/config/Data/Job/Type/Collection/Iterator.yml deleted file mode 100644 index cfec054a..00000000 --- a/src/config/Data/Job/Type/Collection/Iterator.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.data.job.type.collection.iterator: - class: NHDS\Jobs\Data\Job\Type\Collection\Iterator - shared: false - data.job.type.collection.iterator: - alias: nhds.jobs.data.job.type.collection.iterator \ No newline at end of file diff --git a/src/config/Db/Connection/Container.yml b/src/config/Db/Connection/Container.yml deleted file mode 100644 index 625c0924..00000000 --- a/src/config/Db/Connection/Container.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - nhds.jobs.db.connection.container-job: - class: NHDS\Jobs\Db\Connection\Container - calls: - - [setName, ["@=constant('NHDS\\\\Jobs\\\\Db\\\\Connection\\\\ContainerInterface::NAME_JOB')"]] - db.connection.container-job: - alias: nhds.jobs.db.connection.container-job - nhds.jobs.db.connection.container-schema: - class: NHDS\Jobs\Db\Connection\Container - calls: - - [setName, ["@=constant('NHDS\\\\Jobs\\\\Db\\\\Connection\\\\ContainerInterface::NAME_SCHEMA')"]] - db.connection.container-schema: - alias: nhds.jobs.db.connection.container-schema \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_0_0_0.yml b/src/config/Db/Setup/Schema/Version_0_0_0.yml deleted file mode 100644 index 38c37667..00000000 --- a/src/config/Db/Setup/Schema/Version_0_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version.0_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_0_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.setup.schema.version.0_0_0: - alias: nhds.jobs.db.setup.schema.version.0_0_0 \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_1_0_0.yml b/src/config/Db/Setup/Schema/Version_1_0_0.yml deleted file mode 100644 index 1d834895..00000000 --- a/src/config/Db/Setup/Schema/Version_1_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version.1_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_1_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.setup.schema.version.1_0_0: - alias: nhds.jobs.db.setup.schema.version.1_0_0 \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_2_0_0.yml b/src/config/Db/Setup/Schema/Version_2_0_0.yml deleted file mode 100644 index 5b3f6c22..00000000 --- a/src/config/Db/Setup/Schema/Version_2_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version.2_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_2_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.setup.schema.version.2_0_0: - alias: nhds.jobs.db.setup.schema.version.2_0_0 \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_3_0_0.yml b/src/config/Db/Setup/Schema/Version_3_0_0.yml deleted file mode 100644 index a75bba3a..00000000 --- a/src/config/Db/Setup/Schema/Version_3_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version.3_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_3_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.setup.schema.version.3_0_0: - alias: nhds.jobs.db.setup.schema.version.3_0_0 \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_4_0_0.yml b/src/config/Db/Setup/Schema/Version_4_0_0.yml deleted file mode 100644 index 262d18e0..00000000 --- a/src/config/Db/Setup/Schema/Version_4_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version.4_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_4_0_0 - calls: - - [addDbConnectionContainer, ["@nhds.jobs.db.connection.container-schema"]] - db.setup.schema.version.4_0_0: - alias: nhds.jobs.db.setup.schema.version.4_0_0 \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_5_0_0.yml b/src/config/Db/Setup/Schema/Version_5_0_0.yml deleted file mode 100644 index 73245c8f..00000000 --- a/src/config/Db/Setup/Schema/Version_5_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version.5_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_5_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.setup.schema.version.5_0_0: - alias: nhds.jobs.db.setup.schema.version.5_0_0 \ No newline at end of file diff --git a/src/config/Db/Setup/Schema/Version_6_0_0.yml b/src/config/Db/Setup/Schema/Version_6_0_0.yml deleted file mode 100644 index 30f3b351..00000000 --- a/src/config/Db/Setup/Schema/Version_6_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.setup.schema.version_6_0_0: - class: NHDS\Jobs\Db\Setup\Schema\Version_6_0_0 - calls: - - [addDbConnectionContainer, ['@db.connection.container-schema']] - db.setup.schema.version_6_0_0: - alias: nhds.jobs.db.setup.schema.version_6_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_0_0_0.yml b/src/config/Db/TearDown/Schema/Version_0_0_0.yml deleted file mode 100644 index ff11b534..00000000 --- a/src/config/Db/TearDown/Schema/Version_0_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version.0_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_0_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.tear_down.schema.version.0_0_0: - alias: nhds.jobs.db.tear_down.schema.version.0_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_1_0_0.yml b/src/config/Db/TearDown/Schema/Version_1_0_0.yml deleted file mode 100644 index da89aac1..00000000 --- a/src/config/Db/TearDown/Schema/Version_1_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version.1_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_1_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.tear_down.schema.version.1_0_0: - alias: nhds.jobs.db.tear_down.schema.version.1_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_2_0_0.yml b/src/config/Db/TearDown/Schema/Version_2_0_0.yml deleted file mode 100644 index 3a0ba4b5..00000000 --- a/src/config/Db/TearDown/Schema/Version_2_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version.2_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_2_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.tear_down.schema.version.2_0_0: - alias: nhds.jobs.db.tear_down.schema.version.2_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_3_0_0.yml b/src/config/Db/TearDown/Schema/Version_3_0_0.yml deleted file mode 100644 index 54db804d..00000000 --- a/src/config/Db/TearDown/Schema/Version_3_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version.3_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_3_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.tear_down.schema.version.3_0_0: - alias: nhds.jobs.db.tear_down.schema.version.3_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_4_0_0.yml b/src/config/Db/TearDown/Schema/Version_4_0_0.yml deleted file mode 100644 index 2dd213e3..00000000 --- a/src/config/Db/TearDown/Schema/Version_4_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version.4_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_4_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.tear_down.schema.version.4_0_0: - alias: nhds.jobs.db.tear_down.schema.version.4_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_5_0_0.yml b/src/config/Db/TearDown/Schema/Version_5_0_0.yml deleted file mode 100644 index 1b43e71f..00000000 --- a/src/config/Db/TearDown/Schema/Version_5_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version.5_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_5_0_0 - calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] - db.tear_down.schema.version.5_0_0: - alias: nhds.jobs.db.tear_down.schema.version.5_0_0 \ No newline at end of file diff --git a/src/config/Db/TearDown/Schema/Version_6_0_0.yml b/src/config/Db/TearDown/Schema/Version_6_0_0.yml deleted file mode 100644 index c61b7afc..00000000 --- a/src/config/Db/TearDown/Schema/Version_6_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.db.tear_down.schema.version_6_0_0: - class: NHDS\Jobs\Db\TearDown\Schema\Version_6_0_0 - calls: - - [addDbConnectionContainer, ['@db.connection.container-schema']] - db.tear_down.schema.version_6_0_0: - alias: nhds.jobs.db.tear_down.schema.version_6_0_0 \ No newline at end of file diff --git a/src/config/Process.yml b/src/config/Process.yml deleted file mode 100644 index b062ac00..00000000 --- a/src/config/Process.yml +++ /dev/null @@ -1,2 +0,0 @@ -parameters: - process.title.prefix: 'nhds-jobs: ' \ No newline at end of file diff --git a/src/config/Process/Collection/Iterator.yml b/src/config/Process/Collection/Iterator.yml deleted file mode 100644 index 5e9ab54a..00000000 --- a/src/config/Process/Collection/Iterator.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.process.collection.iterator: - shared: false - class: NHDS\Jobs\Process\Collection\Iterator - process.collection.iterator: - alias: nhds.jobs.process.collection.iterator \ No newline at end of file diff --git a/src/config/Process/Registry.yml b/src/config/Process/Registry.yml deleted file mode 100644 index 53944f29..00000000 --- a/src/config/Process/Registry.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.process.registry: - class: NHDS\Jobs\Process\Registry - public: false - shared: true - process.registry: - alias: nhds.jobs.process.registry - public: false \ No newline at end of file diff --git a/src/config/Process/Signal.yml b/src/config/Process/Signal.yml deleted file mode 100644 index c8e1b4d0..00000000 --- a/src/config/Process/Signal.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.process.signal: - class: NHDS\Jobs\Process\Signal - public: false - shared: true - process.signal: - alias: nhds.jobs.process.signal - public: false \ No newline at end of file diff --git a/src/config/Process/Strategy/ProcessControl.yml b/src/config/Process/Strategy/ProcessControl.yml deleted file mode 100644 index e2fc15f7..00000000 --- a/src/config/Process/Strategy/ProcessControl.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - nhds.jobs.process.strategy.process_control: - class: NHDS\Jobs\Process\Strategy\ProcessControl - process.strategy.process_control: - alias: nhds.jobs.process.strategy.process_control \ No newline at end of file diff --git a/src/config/Semaphore.yml b/src/config/Semaphore.yml deleted file mode 100644 index 3aaedfe9..00000000 --- a/src/config/Semaphore.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.semaphore: - class: NHDS\Jobs\Semaphore - public: false - shared: true - semaphore: - alias: nhds.jobs.semaphore - public: false \ No newline at end of file diff --git a/src/config/Semaphore/Resource.yml b/src/config/Semaphore/Resource.yml deleted file mode 100644 index 1034c5c7..00000000 --- a/src/config/Semaphore/Resource.yml +++ /dev/null @@ -1,53 +0,0 @@ -services: - nhds.jobs.semaphore.resource-job: - class: NHDS\Jobs\Semaphore\Resource - shared: false - calls: - - [setIsBlocking, [false]] - semaphore.resource-job: - alias: nhds.jobs.semaphore.resource-job - nhds.jobs.semaphore.resource-maintainer_delete: - class: NHDS\Jobs\Semaphore\Resource - shared: false - calls: - - [setResourceName, ['maintainer_delete.lock']] - - [setResourcePath, ['nhds/jobs']] - - [setIsBlocking, [false]] - semaphore.resource-maintainer_delete: - alias: nhds.jobs.semaphore.resource-maintainer_delete - nhds.jobs.semaphore.resource-update_pending_jobs: - class: NHDS\Jobs\Semaphore\Resource - shared: false - calls: - - [setResourceName, ['update_pending_jobs.lock']] - - [setResourcePath, ['nhds/jobs']] - - [setIsBlocking, [false]] - semaphore.resource-update_pending_jobs: - alias: nhds.jobs.semaphore.resource-update_pending_jobs - nhds.jobs.semaphore.resource-reschedule_jobs: - class: NHDS\Jobs\Semaphore\Resource - shared: false - calls: - - [setResourceName, ['reschedule_jobs.lock']] - - [setResourcePath, ['nhds/jobs']] - - [setIsBlocking, [false]] - semaphore.resource-reschedule_jobs: - alias: nhds.jobs.semaphore.resource-reschedule_jobs - nhds.jobs.semaphore.resource-schedule: - class: NHDS\Jobs\Semaphore\Resource - calls: - - [setResourceName, ['schedule.lock']] - - [setResourcePath, ['nhds/jobs']] - - [setIsBlocking, [false]] - shared: false - semaphore.resource-schedule: - alias: nhds.jobs.semaphore.resource-schedule - nhds.jobs.semaphore.resource-server: - class: NHDS\Jobs\Semaphore\Resource - shared: false - calls: - - [setResourceName, ['server.lock']] - - [setResourcePath, ['nhds/jobs']] - - [setIsBlocking, [false]] - semaphore.resource-server: - alias: nhds.jobs.semaphore.resource-server \ No newline at end of file diff --git a/src/config/Semaphore/Resource/Owner/Job.yml b/src/config/Semaphore/Resource/Owner/Job.yml deleted file mode 100644 index 5163583a..00000000 --- a/src/config/Semaphore/Resource/Owner/Job.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - nhds.jobs.semaphore.resource.owner.job: - class: NHDS\Jobs\Semaphore\Resource\Owner\Job - semaphore.resource.owner.job: - alias: nhds.jobs.semaphore.resource.owner.job \ No newline at end of file diff --git a/src/config/Service/Update/Complete/Failed.yml b/src/config/Service/Update/Complete/Failed.yml deleted file mode 100644 index 4d28d92f..00000000 --- a/src/config/Service/Update/Complete/Failed.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.complete.failed: - class: NHDS\Jobs\Service\Update\Complete\Failed - shared: false - service.update.complete.failed: - alias: nhds.jobs.service.update.complete.failed \ No newline at end of file diff --git a/src/config/Service/Update/Complete/Failed/Factory.yml b/src/config/Service/Update/Complete/Failed/Factory.yml deleted file mode 100644 index bdf130d0..00000000 --- a/src/config/Service/Update/Complete/Failed/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.complete.failed.factory: - class: NHDS\Jobs\Service\Update\Complete\Failed\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateCompleteFailed, ['@service.update.complete.failed']] - service.update.complete.failed.factory: - alias: nhds.jobs.service.update.complete.failed.factory \ No newline at end of file diff --git a/src/config/Service/Update/Complete/FailedScheduleLimitCheck.yml b/src/config/Service/Update/Complete/FailedScheduleLimitCheck.yml deleted file mode 100644 index 571fde3a..00000000 --- a/src/config/Service/Update/Complete/FailedScheduleLimitCheck.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.complete.failedschedulelimitcheck: - class: NHDS\Jobs\Service\Update\Complete\FailedScheduleLimitCheck - shared: false - service.update.complete.failedschedulelimitcheck: - alias: nhds.jobs.service.update.complete.failedschedulelimitcheck \ No newline at end of file diff --git a/src/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml b/src/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml deleted file mode 100644 index 6ab4313d..00000000 --- a/src/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.complete.failedschedulelimitcheck.factory: - class: NHDS\Jobs\Service\Update\Complete\FailedScheduleLimitCheck\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateCompleteFailedScheduleLimitCheck, ['@service.update.complete.failedschedulelimitcheck']] - service.update.complete.failedschedulelimitcheck.factory: - alias: nhds.jobs.service.update.complete.failedschedulelimitcheck.factory \ No newline at end of file diff --git a/src/config/Service/Update/Complete/Success.yml b/src/config/Service/Update/Complete/Success.yml deleted file mode 100644 index c5d460a2..00000000 --- a/src/config/Service/Update/Complete/Success.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.complete.success: - class: NHDS\Jobs\Service\Update\Complete\Success - shared: false - service.update.complete.success: - alias: nhds.jobs.service.update.complete.success \ No newline at end of file diff --git a/src/config/Service/Update/Complete/Success/Factory.yml b/src/config/Service/Update/Complete/Success/Factory.yml deleted file mode 100644 index e5a1c974..00000000 --- a/src/config/Service/Update/Complete/Success/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.complete.success.factory: - class: NHDS\Jobs\Service\Update\Complete\Success\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateCompleteSuccess, ['@service.update.complete.success']] - service.update.complete.success.factory: - alias: nhds.jobs.service.update.complete.success.factory \ No newline at end of file diff --git a/src/config/Service/Update/Crash.yml b/src/config/Service/Update/Crash.yml deleted file mode 100644 index 29a1b832..00000000 --- a/src/config/Service/Update/Crash.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.crash: - class: NHDS\Jobs\Service\Update\Crash - shared: false - service.update.crash: - alias: nhds.jobs.service.update.crash \ No newline at end of file diff --git a/src/config/Service/Update/Crash/Factory.yml b/src/config/Service/Update/Crash/Factory.yml deleted file mode 100644 index 7810f1f0..00000000 --- a/src/config/Service/Update/Crash/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.crash.factory: - class: NHDS\Jobs\Service\Update\Crash\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateCrash, ['@service.update.crash']] - service.update.crash.factory: - alias: nhds.jobs.service.update.crash.factory \ No newline at end of file diff --git a/src/config/Service/Update/Hold.yml b/src/config/Service/Update/Hold.yml deleted file mode 100644 index 907c0e3c..00000000 --- a/src/config/Service/Update/Hold.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.hold: - class: NHDS\Jobs\Service\Update\Hold - shared: false - service.update.hold: - alias: nhds.jobs.service.update.hold \ No newline at end of file diff --git a/src/config/Service/Update/Hold/Factory.yml b/src/config/Service/Update/Hold/Factory.yml deleted file mode 100644 index f49749cd..00000000 --- a/src/config/Service/Update/Hold/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.hold.factory: - class: NHDS\Jobs\Service\Update\Hold\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateHold, ['@service.update.hold']] - service.update.hold.factory: - alias: nhds.jobs.service.update.hold.factory \ No newline at end of file diff --git a/src/config/Service/Update/Panic.yml b/src/config/Service/Update/Panic.yml deleted file mode 100644 index 38cc6090..00000000 --- a/src/config/Service/Update/Panic.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.panic: - class: NHDS\Jobs\Service\Update\Panic - shared: false - service.update.panic: - alias: nhds.jobs.service.update.panic \ No newline at end of file diff --git a/src/config/Service/Update/Panic/Factory.yml b/src/config/Service/Update/Panic/Factory.yml deleted file mode 100644 index b92fd36c..00000000 --- a/src/config/Service/Update/Panic/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.panic.factory: - class: NHDS\Jobs\Service\Update\Panic\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdatePanic, ['@service.update.panic']] - service.update.panic.factory: - alias: nhds.jobs.service.update.panic.factory \ No newline at end of file diff --git a/src/config/Service/Update/Retry.yml b/src/config/Service/Update/Retry.yml deleted file mode 100644 index 01da0299..00000000 --- a/src/config/Service/Update/Retry.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.retry: - class: NHDS\Jobs\Service\Update\Retry - shared: false - service.update.retry: - alias: nhds.jobs.service.update.retry \ No newline at end of file diff --git a/src/config/Service/Update/Retry/Factory.yml b/src/config/Service/Update/Retry/Factory.yml deleted file mode 100644 index b6811854..00000000 --- a/src/config/Service/Update/Retry/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.retry.factory: - class: NHDS\Jobs\Service\Update\Retry\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateRetry, ['@service.update.retry']] - service.update.retry.factory: - alias: nhds.jobs.service.update.retry.factory \ No newline at end of file diff --git a/src/config/Service/Update/Wait.yml b/src/config/Service/Update/Wait.yml deleted file mode 100644 index 13308891..00000000 --- a/src/config/Service/Update/Wait.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.wait: - class: NHDS\Jobs\Service\Update\Wait - shared: false - service.update.wait: - alias: nhds.jobs.service.update.wait \ No newline at end of file diff --git a/src/config/Service/Update/Wait/Factory.yml b/src/config/Service/Update/Wait/Factory.yml deleted file mode 100644 index 1edfc836..00000000 --- a/src/config/Service/Update/Wait/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.wait.factory: - class: NHDS\Jobs\Service\Update\Wait\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateWait, ['@service.update.wait']] - service.update.wait.factory: - alias: nhds.jobs.service.update.wait.factory \ No newline at end of file diff --git a/src/config/Service/Update/Work.yml b/src/config/Service/Update/Work.yml deleted file mode 100644 index 030d4049..00000000 --- a/src/config/Service/Update/Work.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.service.update.work: - class: NHDS\Jobs\Service\Update\Work - shared: false - service.update.work: - alias: nhds.jobs.service.update.work \ No newline at end of file diff --git a/src/config/Service/Update/Work/Factory.yml b/src/config/Service/Update/Work/Factory.yml deleted file mode 100644 index b9382fd7..00000000 --- a/src/config/Service/Update/Work/Factory.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - nhds.jobs.service.update.work.factory: - class: NHDS\Jobs\Service\Update\Work\Factory - calls: - - [setStateService, ['@state.service']] - - [setServiceUpdateWork, ['@service.update.work']] - service.update.work.factory: - alias: nhds.jobs.service.update.work.factory \ No newline at end of file diff --git a/src/config/Type/Repository.yml b/src/config/Type/Repository.yml deleted file mode 100644 index 2ca95a70..00000000 --- a/src/config/Type/Repository.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.type.repository: - class: NHDS\Jobs\Type\Repository - calls: - - [setJobType, ['@data.job.type']] - type.repository: - alias: nhds.jobs.type.repository \ No newline at end of file diff --git a/src/config/Type/Service/Create.yml b/src/config/Type/Service/Create.yml deleted file mode 100644 index c7111028..00000000 --- a/src/config/Type/Service/Create.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - nhds.jobs.type.service.create: - class: NHDS\Jobs\Type\Service\Create - calls: - - [setJobType, ['@data.job.type']] - type.service.create: - alias: nhds.jobs.type.service.create \ No newline at end of file diff --git a/src/config/Worker/Bootstrap.yml b/src/config/Worker/Bootstrap.yml deleted file mode 100644 index d9ee412c..00000000 --- a/src/config/Worker/Bootstrap.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - nhds.jobs.worker.bootstrap: - class: NHDS\Jobs\Worker\Bootstrap - worker.bootstrap: - alias: nhds.jobs.worker.bootstrap \ No newline at end of file diff --git a/src/config/Worker/Locator.yml b/src/config/Worker/Locator.yml deleted file mode 100644 index 044eb5b4..00000000 --- a/src/config/Worker/Locator.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - nhds.jobs.worker.locator: - class: NHDS\Jobs\Worker\Locator - shared: false - worker.locator: - alias: nhds.jobs.worker.locator \ No newline at end of file diff --git a/tests/Process/Strategy/Mock.php b/tests/Process/Strategy/Mock.php index 28272263..debfed99 100644 --- a/tests/Process/Strategy/Mock.php +++ b/tests/Process/Strategy/Mock.php @@ -1,9 +1,9 @@ _getTestContainerBuilder()->get('nhds.jobs.maintainer'); + $maintainer = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.maintainer'); $maintainer->deleteCompletedJobs(); return $this; @@ -17,7 +17,7 @@ public function testDelete() public function testUpdatePendingJobs() { - $maintainer = $this->_getTestContainerBuilder()->get('nhds.jobs.maintainer'); + $maintainer = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.maintainer'); $maintainer->updatePendingJobs(); return $this; @@ -25,7 +25,7 @@ public function testUpdatePendingJobs() public function testRescheduleCrashedJobs() { - $maintainer = $this->_getTestContainerBuilder()->get('nhds.jobs.maintainer'); + $maintainer = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.maintainer'); $maintainer->rescheduleCrashedJobs(); return $this; diff --git a/tests/Unit/Process/PooIInterfaceTest.php b/tests/Unit/Process/PooIInterfaceTest.php index 0d69eb49..c08917d3 100644 --- a/tests/Unit/Process/PooIInterfaceTest.php +++ b/tests/Unit/Process/PooIInterfaceTest.php @@ -1,9 +1,9 @@ _getTestContainerBuilder()->get('nhds.jobs.process.pool.server'); + $server = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.process.pool.server'); // $server->start(); } diff --git a/tests/Unit/SchedulerInterfaceTest.php b/tests/Unit/SchedulerInterfaceTest.php index 6fb1fc04..26ecdac0 100644 --- a/tests/Unit/SchedulerInterfaceTest.php +++ b/tests/Unit/SchedulerInterfaceTest.php @@ -1,7 +1,7 @@ _getTestContainerBuilder()->get('nhds.jobs.scheduler'); + $scheduler = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.scheduler'); $scheduler->scheduleStaticJobs(); return $this; diff --git a/tests/Unit/SelectorInterfaceTest.php b/tests/Unit/SelectorInterfaceTest.php index 3be682e3..d5e8c7b2 100644 --- a/tests/Unit/SelectorInterfaceTest.php +++ b/tests/Unit/SelectorInterfaceTest.php @@ -1,7 +1,7 @@ _getTestContainerBuilder()->get('nhds.jobs.semaphore'); - $resource = $this->_getTestContainerBuilder()->get('nhds.jobs.semaphore.resource-job'); - $job = $this->_getTestContainerBuilder()->get('nhds.jobs.data.job'); + $semaphore = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.semaphore'); + $resource = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.semaphore.resource-job'); + $job = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.data.job'); $job->setId(15); $job->setTypeCode('type_code'); $job->setCanWorkInParallel(true); diff --git a/tests/Unit/Service/CreateInterfaceTest.php b/tests/Unit/Service/CreateInterfaceTest.php index f6559f0e..d1e2cd77 100644 --- a/tests/Unit/Service/CreateInterfaceTest.php +++ b/tests/Unit/Service/CreateInterfaceTest.php @@ -1,7 +1,7 @@ Date: Wed, 28 Mar 2018 16:15:21 -0500 Subject: [PATCH 07/44] splash swag --- src/Console/CommandAbstract.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Console/CommandAbstract.php b/src/Console/CommandAbstract.php index d414920a..260294a2 100644 --- a/src/Console/CommandAbstract.php +++ b/src/Console/CommandAbstract.php @@ -69,10 +69,11 @@ protected function _writeSplash(): CommandAbstract { $this->_getOutput()->writeln( [ - 'Neighborhoods Kōjō', - '===========================', - 'A distributed task manager.', - '', + '+------------------------------+', + '| ⚡ Neighborhoods Kōjō ⚡ |', + '| ========================== |', + '| A distributed task manager |', + '+------------------------------+', ] ); From 6cd151e87ff8f3b99d523f7e8edd3dc9e5a038a3 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 28 Mar 2018 16:18:08 -0500 Subject: [PATCH 08/44] README updates --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bcfaabf..93e5c9c5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,7 @@ # Neighborhoods Kōjō -A distributed task manager. \ No newline at end of file +A distributed task manager. + +### Example usage +```bash +$ bin/kojo process:pool:server:start $PWD/example/config/root.yml +``` \ No newline at end of file From ad34442fc1ff38242877237b915003e4fd1d603f Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 28 Mar 2018 16:57:51 -0500 Subject: [PATCH 09/44] README updates --- src/Console/CommandAbstract.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Console/CommandAbstract.php b/src/Console/CommandAbstract.php index 260294a2..c32c1dc4 100644 --- a/src/Console/CommandAbstract.php +++ b/src/Console/CommandAbstract.php @@ -71,7 +71,9 @@ protected function _writeSplash(): CommandAbstract [ '+------------------------------+', '| ⚡ Neighborhoods Kōjō ⚡ |', - '| ========================== |', + '| |', + '| 工場 |', + '| |', '| A distributed task manager |', '+------------------------------+', ] From 66cfda8ffd95ca6f35bf2bcc82b579a745ad7690 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Thu, 29 Mar 2018 10:35:43 -0500 Subject: [PATCH 10/44] - splersh ert - redmeh --- README.md | 3 ++- src/Console/CommandAbstract.php | 25 ++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 93e5c9c5..a7c527fa 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Neighborhoods Kōjō +# ⚡ Neighborhoods Kōjō ⚡ +# 工場 A distributed task manager. ### Example usage diff --git a/src/Console/CommandAbstract.php b/src/Console/CommandAbstract.php index c32c1dc4..05fa4412 100644 --- a/src/Console/CommandAbstract.php +++ b/src/Console/CommandAbstract.php @@ -13,6 +13,15 @@ abstract class CommandAbstract extends Command { use Strict\AwareTrait; const ARG_SERVICES_YML_FILE_PATH = 'services_yml_file_path'; + const SPLASH_ART = [ + '+------------------------------+', + '| ⚡ Neighborhoods Kōjō ⚡ |', + '| |', + '| 工場 |', + '| |', + '| A distributed task manager |', + '+------------------------------+', + ]; public function configure() { @@ -33,7 +42,7 @@ public function execute(InputInterface $input, OutputInterface $output) { $this->_setInput($input); $this->_setOutput($output); - $this->_writeSplash(); + $this->_writeSplashArt(); $this->_execute(); return $this; @@ -65,19 +74,9 @@ protected function _getInput(): InputInterface abstract function _execute(): CommandAbstract; - protected function _writeSplash(): CommandAbstract + protected function _writeSplashArt(): CommandAbstract { - $this->_getOutput()->writeln( - [ - '+------------------------------+', - '| ⚡ Neighborhoods Kōjō ⚡ |', - '| |', - '| 工場 |', - '| |', - '| A distributed task manager |', - '+------------------------------+', - ] - ); + $this->_getOutput()->writeln(self::SPLASH_ART); return $this; } From 03f8742033e03f58fa672dd81ee308d06a748901 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 4 Apr 2018 14:35:13 -0500 Subject: [PATCH 11/44] - updates --- composer.json | 10 +- composer.lock | 64 +++---- docker/build.sh | 2 +- .../ContainerBuilder/AwareTrait.php | 57 ------- .../Data/Property/Persistent/AwareTrait.php | 127 -------------- .../Data/Property/Strict/AwareTrait.php | 52 ------ nhdstoolkitsrc/Time.php | 46 ----- nhdstoolkitsrc/Time/AwareTrait.php | 31 ---- nhdstoolkitsrc/TimeInterface.php | 21 --- nhdswatchsrc/AbstractTest.php | 27 --- nhdswatchsrc/Fixture/AbstractTest.php | 119 ------------- .../Fixture/Expression/NumberPool.php | 54 ------ .../Fixture/Expression/Value/AwareTrait.php | 33 ---- .../DbUnit/DataSet/SymfonyYamlParser.php | 31 ---- .../TestCase/ContainerBuilder/AwareTrait.php | 40 ----- nhdswatchsrc/TestCase/Service.php | 13 -- nhdswatchsrc/TestCase/Service/AwareTrait.php | 31 ---- nhdswatchsrc/TestCase/ServiceInterface.php | 8 - nhdswatchsrc/config/TestCase/Service.yml | 7 - nhdswatchsrc/config/root.yml | 12 -- src/CacheItemPool/Repository.php | 2 +- src/Console/CommandAbstract.php | 2 +- src/Data/AutoSchedule/Sqs.php | 2 +- src/Data/Job.php | 4 +- src/Data/Job/Collection/Iterator.php | 2 +- src/Data/Job/Type/Collection/Iterator.php | 2 +- src/Db/Model.php | 2 +- src/Db/Model/CollectionAbstract.php | 2 +- src/Foreman.php | 2 +- src/Maintainer.php | 2 +- src/Maintainer/Delete.php | 2 +- src/Message/Broker/BrokerAbstract.php | 2 +- src/Process/Collection.php | 2 +- src/Process/Collection/Iterator.php | 2 +- src/Process/Pool.php | 44 +++-- src/Process/Pool/Logger.php | 4 +- src/Process/Pool/Server.php | 4 +- src/Process/Pool/StrategyAbstract.php | 2 +- src/Process/PoolAbstract.php | 5 +- src/Process/PoolInterface.php | 7 +- src/Process/Signal.php | 92 ++++++++-- src/Process/Signal/HandlerInterface.php | 9 + src/Process/Signal/Information.php | 160 ++++++++++++++++++ src/Process/Signal/Information/AwareTrait.php | 38 +++++ src/Process/Signal/Information/Collection.php | 61 +++++++ .../Information/Collection/AwareTrait.php | 38 +++++ .../Information/CollectionInterface.php | 23 +++ src/Process/Signal/InformationInterface.php | 59 +++++++ src/Process/SignalInterface.php | 18 +- src/ProcessAbstract.php | 2 +- src/Redis/Factory.php | 2 +- src/Redis/Repository.php | 2 +- src/Scheduler.php | 4 +- src/Scheduler/Cache.php | 4 +- src/Scheduler/Time.php | 4 +- src/Selector.php | 2 +- src/Semaphore/Mutex/Flock.php | 2 +- src/Semaphore/Mutex/Redis.php | 2 +- src/Semaphore/Resource.php | 2 +- src/Semaphore/Resource/Factory.php | 2 +- src/Semaphore/Resource/Owner/Job.php | 2 +- src/Service/Container.php | 2 +- src/Service/Create.php | 2 +- src/Service/FactoryAbstract.php | 2 +- src/ServiceAbstract.php | 2 +- src/State/Service.php | 4 +- src/Type/Repository.php | 2 +- src/Type/ServiceAbstract.php | 2 +- src/Worker/BootstrapAbstract.php | 2 +- src/Worker/Job/Service.php | 2 +- src/Worker/Locator.php | 2 +- 71 files changed, 601 insertions(+), 830 deletions(-) delete mode 100644 nhdstoolkitsrc/ContainerBuilder/AwareTrait.php delete mode 100644 nhdstoolkitsrc/Data/Property/Persistent/AwareTrait.php delete mode 100644 nhdstoolkitsrc/Data/Property/Strict/AwareTrait.php delete mode 100644 nhdstoolkitsrc/Time.php delete mode 100644 nhdstoolkitsrc/Time/AwareTrait.php delete mode 100644 nhdstoolkitsrc/TimeInterface.php delete mode 100644 nhdswatchsrc/AbstractTest.php delete mode 100644 nhdswatchsrc/Fixture/AbstractTest.php delete mode 100644 nhdswatchsrc/Fixture/Expression/NumberPool.php delete mode 100644 nhdswatchsrc/Fixture/Expression/Value/AwareTrait.php delete mode 100644 nhdswatchsrc/PHPUnit/DbUnit/DataSet/SymfonyYamlParser.php delete mode 100644 nhdswatchsrc/TestCase/ContainerBuilder/AwareTrait.php delete mode 100644 nhdswatchsrc/TestCase/Service.php delete mode 100644 nhdswatchsrc/TestCase/Service/AwareTrait.php delete mode 100644 nhdswatchsrc/TestCase/ServiceInterface.php delete mode 100644 nhdswatchsrc/config/TestCase/Service.yml delete mode 100644 nhdswatchsrc/config/root.yml create mode 100644 src/Process/Signal/HandlerInterface.php create mode 100644 src/Process/Signal/Information.php create mode 100644 src/Process/Signal/Information/AwareTrait.php create mode 100644 src/Process/Signal/Information/Collection.php create mode 100644 src/Process/Signal/Information/Collection/AwareTrait.php create mode 100644 src/Process/Signal/Information/CollectionInterface.php create mode 100644 src/Process/Signal/InformationInterface.php diff --git a/composer.json b/composer.json index 0e56c08a..7e2a2030 100644 --- a/composer.json +++ b/composer.json @@ -21,26 +21,26 @@ "symfony/expression-language": "~4.0.3", "symfony/cache": "~4.0.3", "symfony/console": "~4.0.3", - "ocramius/proxy-manager": "^2.1" + "ocramius/proxy-manager": "^2.1", + "neighborhoods/pylon": "dev-master" }, "require-dev": { "phpunit/phpunit": "^6.4", "phpunit/dbunit": "^3.0", - "symfony/finder": "^4.0" + "symfony/finder": "^4.0", + "neighborhoods/scaffolding": "dev-master" }, "bin": [ "bin/kojo" ], "autoload": { "psr-4": { - "Neighborhoods\\Kojo\\": "src", - "Neighborhoods\\Toolkit\\": "nhdstoolkitsrc" + "Neighborhoods\\Kojo\\": "src" } }, "autoload-dev": { "psr-4": { "Neighborhoods\\Kojo\\Test\\": "tests", - "Neighborhoods\\Scaffolding\\": "nhdswatchsrc", "Neighborhoods\\Kojo\\Example\\": "example" } } diff --git a/composer.lock b/composer.lock index cdb931b2..e01b2e79 100644 --- a/composer.lock +++ b/composer.lock @@ -365,16 +365,16 @@ }, { "name": "symfony/cache", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "fcffcf7f26d232b64329f37182defe253caa06b0" + "reference": "681c245e629409a2f1ded6bf783e833d291d8af2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/fcffcf7f26d232b64329f37182defe253caa06b0", - "reference": "fcffcf7f26d232b64329f37182defe253caa06b0", + "url": "https://api.github.com/repos/symfony/cache/zipball/681c245e629409a2f1ded6bf783e833d291d8af2", + "reference": "681c245e629409a2f1ded6bf783e833d291d8af2", "shasum": "" }, "require": { @@ -430,20 +430,20 @@ "caching", "psr6" ], - "time": "2018-02-11T17:17:44+00:00" + "time": "2018-04-02T14:35:51+00:00" }, { "name": "symfony/config", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "289eadd3771f7682ea2540e4925861c18ec5b4d0" + "reference": "7c19370ab04e9ac05b74a504198e165f5ccf6dd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/289eadd3771f7682ea2540e4925861c18ec5b4d0", - "reference": "289eadd3771f7682ea2540e4925861c18ec5b4d0", + "url": "https://api.github.com/repos/symfony/config/zipball/7c19370ab04e9ac05b74a504198e165f5ccf6dd8", + "reference": "7c19370ab04e9ac05b74a504198e165f5ccf6dd8", "shasum": "" }, "require": { @@ -492,20 +492,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-02-04T16:43:51+00:00" + "time": "2018-03-19T22:35:49+00:00" }, { "name": "symfony/console", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51" + "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/555c8dbe0ae9e561740451eabdbed2cc554b6a51", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51", + "url": "https://api.github.com/repos/symfony/console/zipball/aad9a6fe47319f22748fd764f52d3a7ca6fa6b64", + "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64", "shasum": "" }, "require": { @@ -560,20 +560,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-02-26T15:55:47+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "symfony/dependency-injection", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "93ad14f124beacf16894b64bb5b3cdd5b4367e38" + "reference": "9f1cea656afc5512c6f5e58d61fcea12acee113e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/93ad14f124beacf16894b64bb5b3cdd5b4367e38", - "reference": "93ad14f124beacf16894b64bb5b3cdd5b4367e38", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/9f1cea656afc5512c6f5e58d61fcea12acee113e", + "reference": "9f1cea656afc5512c6f5e58d61fcea12acee113e", "shasum": "" }, "require": { @@ -631,11 +631,11 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-03-05T18:28:26+00:00" + "time": "2018-04-02T09:52:41+00:00" }, { "name": "symfony/expression-language", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", @@ -685,7 +685,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -793,16 +793,16 @@ }, { "name": "symfony/yaml", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "de5f125ea39de846b90b313b2cfb031a0152d223" + "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/de5f125ea39de846b90b313b2cfb031a0152d223", - "reference": "de5f125ea39de846b90b313b2cfb031a0152d223", + "url": "https://api.github.com/repos/symfony/yaml/zipball/8b34ebb5989df61cbd77eff29a02c4db9ac1069c", + "reference": "8b34ebb5989df61cbd77eff29a02c4db9ac1069c", "shasum": "" }, "require": { @@ -847,7 +847,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-02-19T20:08:53+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "zendframework/zend-code", @@ -2482,16 +2482,16 @@ }, { "name": "symfony/finder", - "version": "v4.0.6", + "version": "v4.0.7", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f" + "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/44a796d2ecc2a16a5fc8f2956a34ee617934d55f", - "reference": "44a796d2ecc2a16a5fc8f2956a34ee617934d55f", + "url": "https://api.github.com/repos/symfony/finder/zipball/c72995d9f5999b3fcdd8660c0c9690243252e1e1", + "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1", "shasum": "" }, "require": { @@ -2527,7 +2527,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-03-05T18:28:26+00:00" + "time": "2018-04-02T09:52:41+00:00" }, { "name": "theseer/tokenizer", diff --git a/docker/build.sh b/docker/build.sh index 70c6717c..b82b6997 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -82,6 +82,6 @@ fi if [ "$INSTALL_XDEBUG" = true ]; then echo "Installing the xdebug extension..." - pecl install xdebug + pecl install xdebug-2.7.0alpha1 docker-php-ext-enable xdebug fi diff --git a/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php b/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php deleted file mode 100644 index 31b33124..00000000 --- a/nhdstoolkitsrc/ContainerBuilder/AwareTrait.php +++ /dev/null @@ -1,57 +0,0 @@ -_servicesYamlFilePaths[$servicesYamlFilePath])) { - $this->_servicesYamlFilePaths[$servicesYamlFilePath] = $servicesYamlFilePath; - }else { - - throw new \LogicException('Services YML file path "' . $servicesYamlFilePath . '" is already set.'); - } - - return $this; - } - - protected function _getServicesYmlFilePaths(): array - { - if (empty($this->_servicesYamlFilePaths)) { - throw new \LogicException('Services YML file paths is empty.'); - } - - return $this->_servicesYamlFilePaths; - } - - public function getContainerBuilder(): ContainerBuilder - { - if ($this->_containerBuilder === null) { - $containerBuilder = new ContainerBuilder(); - $loader = new YamlFileLoader($containerBuilder, new FileLocator(__DIR__)); - foreach ($this->_getServicesYmlFilePaths() as $servicesYmlFilePath) { - $loader->import($servicesYmlFilePath); - } - $passes = [new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()]; - $repeatedPass = new RepeatedPass($passes); - $repeatedPass->process($containerBuilder); - $containerBuilder->set('container_builder', $containerBuilder); - $containerBuilder->compile(true); - $this->_containerBuilder = $containerBuilder; - } - - return $this->_containerBuilder; - } -} \ No newline at end of file diff --git a/nhdstoolkitsrc/Data/Property/Persistent/AwareTrait.php b/nhdstoolkitsrc/Data/Property/Persistent/AwareTrait.php deleted file mode 100644 index a99573dc..00000000 --- a/nhdstoolkitsrc/Data/Property/Persistent/AwareTrait.php +++ /dev/null @@ -1,127 +0,0 @@ -_hasPersistentProperties()) { - $this->_persistentProperties = $persistentProperties; - $this->_changedPersistentProperties = $persistentProperties; - }else { - throw new \LogicException('Persistent properties is already set.'); - } - - return $this; - } - - protected function _emptyPersistentProperties() - { - if ($this->_hasPersistentProperties()) { - $this->_persistentProperties = []; - $this->_changedPersistentProperties = []; - }else { - throw new \LogicException('Persistent properties is not set.'); - } - - return $this; - } - - protected function _hydrate(array $persistentProperties) - { - $this->_persistentProperties = array_replace($this->_persistentProperties, $persistentProperties); - $this->_changedPersistentProperties = []; - - return $this; - } - - protected function _createPersistentProperty(string $persistentPropertyName, $persistentPropertyValue) - { - if ($this->_hasPersistentProperty($persistentPropertyName)) { - throw new \LogicException('Persistent property ' . $persistentPropertyName . ' is already set.'); - }else { - $this->_persistentProperties[$persistentPropertyName] = $persistentPropertyValue; - $this->_changedPersistentProperties[$persistentPropertyName] = $persistentPropertyValue; - } - - return $this; - } - - protected function _readPersistentProperty(string $persistentPropertyName) - { - if (!isset($this->_persistentProperties[$persistentPropertyName])) { - throw new \LogicException('Persistent property ' . $persistentPropertyName . ' is not set'); - } - - return $this->_persistentProperties[$persistentPropertyName]; - } - - protected function _unsetPersistentProperty(string $persistentPropertyName) - { - if ($this->_hasPersistentProperty($persistentPropertyName)) { - unset($this->_persistentProperties[$persistentPropertyName]); - $this->_changedPersistentProperties[$persistentPropertyName] = null; - }else { - throw new \LogicException('Persistent property is not set.'); - } - - return $this; - } - - public function readPersistentProperties(): array - { - if (!$this->_hasPersistentProperties()) { - throw new \LogicException('Persistent properties is not set.'); - } - - return $this->_persistentProperties; - } - - protected function _createOrUpdatePersistentProperty(string $persistentPropertyName, $persistentPropertyValue) - { - $this->_persistentProperties[$persistentPropertyName] = $persistentPropertyValue; - $this->_changedPersistentProperties[$persistentPropertyName] = $persistentPropertyValue; - - return $this; - } - - protected function _hasPersistentProperty(string $persistentPropertyName): bool - { - return isset($this->_persistentProperties[$persistentPropertyName]); - } - - protected function _hasPersistentProperties(): bool - { - return empty($this->_persistentProperties) ? false : true; - } - - public function hasChangedPersistentProperties(): bool - { - return empty($this->_changedPersistentProperties) ? false : true; - } - - protected function _readChangedPersistentProperties(): array - { - if (!$this->hasChangedPersistentProperties()) { - throw new \LogicException('Changed persistent properties is not set.'); - } - - return $this->_changedPersistentProperties; - } - - protected function _emptyChangedPersistentProperties() - { - if ($this->hasChangedPersistentProperties()) { - $this->_changedPersistentProperties = []; - }else { - throw new \LogicException('Changed persistent properties is not set.'); - } - - return $this; - } -} \ No newline at end of file diff --git a/nhdstoolkitsrc/Data/Property/Strict/AwareTrait.php b/nhdstoolkitsrc/Data/Property/Strict/AwareTrait.php deleted file mode 100644 index e2470fdb..00000000 --- a/nhdstoolkitsrc/Data/Property/Strict/AwareTrait.php +++ /dev/null @@ -1,52 +0,0 @@ -_exists($propertyName), new \LogicException($propertyName . ' is already created.')); - $this->_strictProperties[$propertyName] = $propertyValue; - - return $this; - } - - protected function &_read(string $propertyName) - { - assert($this->_exists($propertyName), new \LogicException($propertyName . ' is not created.')); - - return $this->_strictProperties[$propertyName]; - } - - protected function _update(string $propertyName, $propertyValue) - { - assert($this->_exists($propertyName), new \LogicException($propertyName . ' is not created.')); - $this->_strictProperties[$propertyName] = $propertyValue; - - return $this; - } - - protected function _createOrUpdate(string $propertyName, $propertyValue) - { - $this->_strictProperties[$propertyName] = $propertyValue; - - return $this; - } - - protected function _delete(string $propertyName) - { - assert($this->_exists($propertyName), new \LogicException($propertyName . ' is not created.')); - unset($this->_strictProperties[$propertyName]); - - return $this; - } - - protected function _exists(string $propertyName): bool - { - return isset($this->_strictProperties[$propertyName]) ? true : false; - } -} \ No newline at end of file diff --git a/nhdstoolkitsrc/Time.php b/nhdstoolkitsrc/Time.php deleted file mode 100644 index 2f3b2f32..00000000 --- a/nhdstoolkitsrc/Time.php +++ /dev/null @@ -1,46 +0,0 @@ -setTimezone($this->getDateTimeZone($timezoneCode)); - - return $now; - } - - public function getUnixReferenceTimeNow(): string - { - return sprintf('%f', microtime(true)); - } - - public function validateTimestamp(string $timestamp, string $format = TimeInterface::MYSQL_DATE_TIME_FORMAT): bool - { - $dateTime = \DateTime::createFromFormat($format, $timestamp); - - return $dateTime && $dateTime->format($format) == $timestamp; - } - - public function getDateTimeZone(string $timezoneCode = self::DEFAULT_TIMEZONE_CODE): \DateTimeZone - { - if (!isset($this->_dateTimeZones[$timezoneCode])) { - $dateTimeZone = new \DateTimeZone($timezoneCode); - $this->_dateTimeZones[$timezoneCode] = $dateTimeZone; - } - - return clone $this->_dateTimeZones[$timezoneCode]; - } - - public function getNewDateInterval(string $intervalSpec): \DateInterval - { - return new \DateInterval($intervalSpec); - } -} \ No newline at end of file diff --git a/nhdstoolkitsrc/Time/AwareTrait.php b/nhdstoolkitsrc/Time/AwareTrait.php deleted file mode 100644 index 8f824e87..00000000 --- a/nhdstoolkitsrc/Time/AwareTrait.php +++ /dev/null @@ -1,31 +0,0 @@ -_time === null) { - $this->_time = $time; - }else { - throw new \Exception('Time is already set.'); - } - - return $this; - } - - protected function _getTime(): TimeInterface - { - if ($this->_time === null) { - throw new \LogicException('Time is not set.'); - } - - return $this->_time; - } -} \ No newline at end of file diff --git a/nhdstoolkitsrc/TimeInterface.php b/nhdstoolkitsrc/TimeInterface.php deleted file mode 100644 index c681bfab..00000000 --- a/nhdstoolkitsrc/TimeInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -addServicesYmlFilePath($ymlServiceFilePath); - $testCaseService = $this->getContainerBuilder()->get('nhds.watch.testcase.service'); - $this->setTestCaseService($testCaseService); - - parent::setUp(); - } -} \ No newline at end of file diff --git a/nhdswatchsrc/Fixture/AbstractTest.php b/nhdswatchsrc/Fixture/AbstractTest.php deleted file mode 100644 index a9727636..00000000 --- a/nhdswatchsrc/Fixture/AbstractTest.php +++ /dev/null @@ -1,119 +0,0 @@ -addServicesYmlFilePath($ymlServiceFilePath); - $testCaseService = $this->getContainerBuilder()->get('nhds.watch.testcase.service'); - $this->setTestCaseService($testCaseService); - $tearDown = $this->_getTestContainerBuilder()->get('db.tear_down'); - $tearDown->uninstall(); - $setup = $this->_getTestContainerBuilder()->get('db.setup'); - $setup->install(); - $redis = $this->_getTestContainerBuilder()->get('redis'); - $redis->flushAll(); - - parent::setUp(); - } - - protected function getConnection() - { - $pdo = $this->_getTestContainerBuilder()->get('pdo'); - - return $this->createDefaultDBConnection($pdo); - } - - protected function getDataSet() - { - $reflectionClass = new ReflectionClass($this); - $testClassFilePath = $reflectionClass->getFileName(); - $testClassDirectoryPath = dirname($testClassFilePath); - $className = $reflectionClass->getShortName(); - $fixturesDirectoryPath = $testClassDirectoryPath . '/fixtures/' . $className; - $finder = new Finder(); - $finder->files()->in($fixturesDirectoryPath); - $finder->sortByName(); - foreach ($finder as $filePath => $file) { - $this->_addFilePathToYmlDataSet($filePath); - } - - return $this->_getEvaluatedYmlDataSet(); - } - - protected function _addFilePathToYmlDataSet(string $ymlDataSetFilePath): AbstractTest - { - if (!$this->_exists(YamlDataSet::class)) { - $ymlParser = new SymfonyYamlParser(); - $ymlParser->setFlags(Yaml::PARSE_CUSTOM_TAGS); - $this->_create(YamlDataSet::class, new YamlDataSet($ymlDataSetFilePath, $ymlParser)); - }else { - $this->_getYmlDataSet()->addYamlFile($ymlDataSetFilePath); - } - - return $this; - } - - protected function _getEvaluatedYmlDataSet(): YamlDataSet - { - /** @var DefaultTableIterator $tableIterator */ - $tableIterator = $this->_getYmlDataSet()->getIterator(); - $expressionLanguage = new ExpressionLanguage(); - $expressionValues = &$this->_getTestCaseService()->getExpressionValues(); - /** @var DefaultTable $table */ - foreach ($tableIterator as $table) { - $rowCount = $table->getRowCount(); - while (--$rowCount >= 0) { - $row = $table->getRow($rowCount); - foreach ($row as $columnName => $columnValue) { - if ($columnValue instanceof TaggedValue) { - if ($columnValue->getTag() === self::YML_SIGIL_PREFIX_FIXTURE_EXPRESSION) { - $expression = $columnValue->getValue(); - $expressedValue = $expressionLanguage->evaluate($expression, $expressionValues); - $table->setValue($rowCount, $columnName, $expressedValue); - } - } - } - } - } - - return $this->_getYmlDataSet(); - } - - protected function _getYmlDataSet(): YamlDataSet - { - return $this->_read(YamlDataSet::class); - } - - protected function _getTime(): TimeInterface - { - return $this->_getTestContainerBuilder()->get('nhds.toolkit.time'); - } -} \ No newline at end of file diff --git a/nhdswatchsrc/Fixture/Expression/NumberPool.php b/nhdswatchsrc/Fixture/Expression/NumberPool.php deleted file mode 100644 index 18cae7c9..00000000 --- a/nhdswatchsrc/Fixture/Expression/NumberPool.php +++ /dev/null @@ -1,54 +0,0 @@ -isPoolInitialized($poolName)) { - $this->_initializePoolName($poolName); - } - - return $this->_nextNumberPool[$poolName]; - } - - public function advance(string $poolName): NumberPool - { - if (!$this->isPoolInitialized($poolName)) { - $this->_initializePoolName($poolName); - } - ++$this->_nextNumberPool[$poolName]; - - return $this; - } - - public function rewind(string $poolName): NumberPool - { - if (!$this->isPoolInitialized($poolName)) { - $this->_initializePoolName($poolName); - } - ++$this->_nextNumberPool[$poolName]; - - return $this; - } - - public function isPoolInitialized(string $poolName): bool - { - return isset($this->_nextNumberPool[$poolName]) ? true : false; - } - - protected function _initializePoolName(string $poolName): NumberPool - { - if (isset($this->_nextNumberPool[$poolName])) { - throw new \LogicException('Pool name is already initialized.'); - } - - $this->_nextNumberPool[$poolName] = 0; - - return $this; - } -} \ No newline at end of file diff --git a/nhdswatchsrc/Fixture/Expression/Value/AwareTrait.php b/nhdswatchsrc/Fixture/Expression/Value/AwareTrait.php deleted file mode 100644 index bb1d321e..00000000 --- a/nhdswatchsrc/Fixture/Expression/Value/AwareTrait.php +++ /dev/null @@ -1,33 +0,0 @@ -_expressionValues[$valueName])) { - throw new \LogicException('Expression value with value name "' . $valueName . '" is already set."'); - } - $this->_expressionValues[$valueName] = $value; - - return $this; - } - - public function hasExpressionValues(): bool - { - return empty($this->_expressionValues) ? false : true; - } - - public function &getExpressionValues(): array - { - if (empty($this->_expressionValues)) { - throw new \LogicException('Expression values is empty.'); - } - - return $this->_expressionValues; - } -} \ No newline at end of file diff --git a/nhdswatchsrc/PHPUnit/DbUnit/DataSet/SymfonyYamlParser.php b/nhdswatchsrc/PHPUnit/DbUnit/DataSet/SymfonyYamlParser.php deleted file mode 100644 index 40e96e3f..00000000 --- a/nhdswatchsrc/PHPUnit/DbUnit/DataSet/SymfonyYamlParser.php +++ /dev/null @@ -1,31 +0,0 @@ -_create(self::PROP_FLAGS, $flags); - - return $this; - } - - protected function _getFlags() - { - return $this->_read(self::PROP_FLAGS); - } - - public function parseYaml($yamlFile) - { - return Yaml::parse(\file_get_contents($yamlFile), $this->_getFlags()); - } -} \ No newline at end of file diff --git a/nhdswatchsrc/TestCase/ContainerBuilder/AwareTrait.php b/nhdswatchsrc/TestCase/ContainerBuilder/AwareTrait.php deleted file mode 100644 index b4971afb..00000000 --- a/nhdswatchsrc/TestCase/ContainerBuilder/AwareTrait.php +++ /dev/null @@ -1,40 +0,0 @@ -_exists('test_container_builder')) { - $reflectionClass = new ReflectionClass($this); - $testClassFilePath = $reflectionClass->getFileName(); - $testClassDirectoryPath = dirname($testClassFilePath); - $shortName = $reflectionClass->getShortName(); - $testServicesYamlFilePath = $testClassDirectoryPath . '/config/' . $shortName . '.yml'; - $testContainerBuilder = new ContainerBuilder(); - $loader = new YamlFileLoader($testContainerBuilder, new FileLocator(__DIR__)); - $loader->load($testServicesYamlFilePath); - $passes = [new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()]; - $repeatedPass = new RepeatedPass($passes); - $repeatedPass->process($testContainerBuilder); - $testContainerBuilder->set('test_container_builder', $testContainerBuilder); - $testContainerBuilder->compile(true); - $this->_create('test_container_builder', $testContainerBuilder); - } - - return $this->_read('test_container_builder'); - } -} \ No newline at end of file diff --git a/nhdswatchsrc/TestCase/Service.php b/nhdswatchsrc/TestCase/Service.php deleted file mode 100644 index 8499a673..00000000 --- a/nhdswatchsrc/TestCase/Service.php +++ /dev/null @@ -1,13 +0,0 @@ -_testCaseService === null) { - $this->_testCaseService = $testCaseService; - }else { - throw new \LogicException('Test case service is already set.'); - } - - return $this; - } - - protected function _getTestCaseService(): TestCase\Service - { - if ($this->_testCaseService === null) { - throw new \LogicException('Test case service is not set.'); - } - - return $this->_testCaseService; - } -} \ No newline at end of file diff --git a/nhdswatchsrc/TestCase/ServiceInterface.php b/nhdswatchsrc/TestCase/ServiceInterface.php deleted file mode 100644 index 9b74d9c4..00000000 --- a/nhdswatchsrc/TestCase/ServiceInterface.php +++ /dev/null @@ -1,8 +0,0 @@ -_processControlWaitError(); - } - $childProcessExitCode = pcntl_wexitstatus($status); - $childProcess = $this->getChildProcess($childProcessId)->setExitCode($childProcessExitCode); - $this->_getProcessPoolStrategy()->childProcessExited($childProcess); - $this->_validateAlarm(); + $this->_getLogger()->info("Received signal number[$signalNumber]."); + switch ($signalNumber) { + case SIGCHLD: + $this->childExitSignal($signalInformation); + break; + case SIGALRM: + $this->alarmSignal(); + break; + case SIGTERM: + case SIGINT: + case SIGHUP: + case SIGQUIT: + case SIGABRT: + $this->getProcess()->receivedSignal($signalNumber, $this->_signalInformation); + break; + default: + throw new \UnexpectedValueException("Unexpected signal number [$signalNumber]."); } + + return $this; + } + + public function childExitSignal(InformationInterface $information): PoolInterface + { + $childProcessExitCode = pcntl_wexitstatus($status); + $childProcess = $this->getChildProcess($childProcessId)->setExitCode($childProcessExitCode); + $this->_getProcessPoolStrategy()->childProcessExited($childProcess); + $this->_validateAlarm(); $this->_getProcessPoolStrategy()->currentPendingChildExitsCompleted(); return $this; @@ -90,7 +111,7 @@ protected function _processControlWaitError() public function addChildProcess(ProcessInterface $childProcess): PoolInterface { - $this->_getProcessSignal()->block(); + $this->_getProcessSignal()->incrementWaitCount(); if ($this->isFull()) { throw new \LogicException('Process pool is full.'); }else { @@ -99,7 +120,7 @@ public function addChildProcess(ProcessInterface $childProcess): PoolInterface $message = "Forked Process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; $this->_getLogger()->info($message); } - $this->_getProcessSignal()->unBlock(); + $this->_getProcessSignal()->decrementWaitCount(); return $this; } @@ -146,7 +167,6 @@ public function terminateChildProcesses(): PoolInterface unset($this->_childProcesses[$processId]); } } - $this->_getProcessSignal()->unBlock(); return $this; } diff --git a/src/Process/Pool/Logger.php b/src/Process/Pool/Logger.php index 0aea631d..4b92313b 100644 --- a/src/Process/Pool/Logger.php +++ b/src/Process/Pool/Logger.php @@ -4,9 +4,9 @@ namespace Neighborhoods\Kojo\Process\Pool; use Psr\Log; -use Neighborhoods\Toolkit\Time; +use Neighborhoods\Pylon\Time; use Neighborhoods\Kojo\ProcessInterface; -use Neighborhoods\Toolkit\Data\Property\Strict; +use Neighborhoods\Pylon\Data\Property\Defensive; class Logger extends Log\AbstractLogger implements LoggerInterface { diff --git a/src/Process/Pool/Server.php b/src/Process/Pool/Server.php index e37ea1df..9c8b7593 100644 --- a/src/Process/Pool/Server.php +++ b/src/Process/Pool/Server.php @@ -6,13 +6,13 @@ use Neighborhoods\Kojo\ProcessAbstract; use Neighborhoods\Kojo\ProcessInterface; use Neighborhoods\Kojo\Semaphore; -use Neighborhoods\Toolkit\Data\Property; +use Neighborhoods\Pylon\Data\Property; use Neighborhoods\Kojo\Process; class Server extends ProcessAbstract implements ServerInterface { use Process\Pool\Factory\AwareTrait; - use Property\Strict\AwareTrait; + use Property\Defensive\AwareTrait; use Logger\AwareTrait; use Semaphore\AwareTrait; use Semaphore\Resource\Factory\AwareTrait; diff --git a/src/Process/Pool/StrategyAbstract.php b/src/Process/Pool/StrategyAbstract.php index 8d5f352a..356ea0ca 100644 --- a/src/Process/Pool/StrategyAbstract.php +++ b/src/Process/Pool/StrategyAbstract.php @@ -3,7 +3,7 @@ namespace Neighborhoods\Kojo\Process\Pool; -use Neighborhoods\Toolkit\Data\Property\Strict; +use Neighborhoods\Pylon\Data\Property\Defensive; use Neighborhoods\Kojo\Process\Collection; abstract class StrategyAbstract implements StrategyInterface diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index 7b9c89cc..afc05c74 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -5,7 +5,7 @@ use Neighborhoods\Kojo\Process; use Neighborhoods\Kojo\ProcessInterface; -use Neighborhoods\Toolkit\Data\Property\Strict; +use Neighborhoods\Pylon\Data\Property\Defensive; abstract class PoolAbstract implements PoolInterface { @@ -15,6 +15,8 @@ abstract class PoolAbstract implements PoolInterface use Process\AwareTrait; use Process\Signal\AwareTrait; + abstract public function childExitSignal(): PoolInterface; + public function hasAlarm(): bool { $hasAlarm = false; @@ -53,6 +55,7 @@ public function isFull(): bool protected function _initialize(): PoolInterface { + $this->_getProcessSignal()->addSignalHandler(SIGCHLD, [$this, 'childExitSignal']); $this->_getProcessPoolStrategy()->initializePool(); return $this; diff --git a/src/Process/PoolInterface.php b/src/Process/PoolInterface.php index 54ca60ca..7b01df25 100644 --- a/src/Process/PoolInterface.php +++ b/src/Process/PoolInterface.php @@ -5,8 +5,9 @@ use Neighborhoods\Kojo\Process\Pool\StrategyInterface; use Neighborhoods\Kojo\ProcessInterface; +use Neighborhoods\Jobs\Process\Signal\HandlerInterface; -interface PoolInterface +interface PoolInterface extends HandlerInterface { public function start(): PoolInterface; @@ -37,4 +38,8 @@ public function setProcess(ProcessInterface $process); public function getProcess(): ProcessInterface; public function waitForSignal(): PoolInterface; + + public function childExitSignal(): PoolInterface; + + public function alarmSignal(): PoolInterface; } \ No newline at end of file diff --git a/src/Process/Signal.php b/src/Process/Signal.php index 791bd909..6c8195b2 100644 --- a/src/Process/Signal.php +++ b/src/Process/Signal.php @@ -3,47 +3,109 @@ namespace Neighborhoods\Kojo\Process; +use Neighborhoods\Kojo\Process\Signal\HandlerInterface; +use Neighborhoods\Pylon\Data\Property\Defensive; +use Neighborhoods\Kojo\Process; + class Signal implements SignalInterface { - protected $_blockedSignalNumbers = []; - protected $_isBlocked = false; + use Strict\AwareTrait; + use Process\Signal\Information\AwareTrait; + protected $_waitCount = 0; + protected $_signalHandlers = []; + protected $_bufferedSignals = []; + + public function addSignalHandler(int $signalNumber, HandlerInterface $signalHandler): SignalInterface + { + $this->incrementWaitCount(); + $this->_signalHandlers[$signalNumber] = $signalHandler; + pcntl_signal($signalNumber, [$this, 'handleSignal']); + $this->decrementWaitCount(); + + return $this; + } - public function &_getBlockingSignalNumbers(): array + public function incrementWaitCount(): SignalInterface { - if (empty($this->_blockedSignalNumbers)) { - pcntl_async_signals(true); - $this->_blockedSignalNumbers = self::DEFAULT_BLOCKED_SIGNAL_NUMBERS; + ++$this->_waitCount; + + return $this; + } + + public function decrementWaitCount(): SignalInterface + { + while ($this->_waitCount >= 1) { + $this->_processBufferedSignals(); + --$this->_waitCount; } - return $this->_blockedSignalNumbers; + return $this; } - public function addBlockedSignalNumber(int $signalNumber): SignalInterface + protected function _processBufferedSignals(): SignalInterface { - $this->_blockedSignalNumbers[$signalNumber] = $signalNumber; + foreach ($this->_bufferedSignals as $position => $information) { + call_user_func([$this->_getSignalHandler($information->getSignalNumber()), 'handleSignal'], $information); + unset($this->_bufferedSignals[$position]); + } return $this; } - public function addSignalHandler(int $signalNumber, callable $signalHandler): SignalInterface + protected function _getSignalHandler(int $signalNumber): HandlerInterface + { + if (!isset($this->_signalHandlers[$signalNumber])) { + throw new \LogicException("Signal handler for signal number[$signalNumber] is not set."); + } + + return $this->_signalHandlers[$signalNumber]; + } + + /** + * Signals are "blocked" by PHP while the IRQ handling logic is executed + * from the context of being called by the VM as a signal handler. + */ + public function handleSignal(int $signalNumber, $signalInformation): void + { + if ($signalNumber === SIGCHLD) { + $childProcessId = pcntl_wait($status, WNOHANG); + if ($childProcessId == -1) { + $error = var_export(pcntl_strerror(pcntl_get_last_error()), true); + }else { + $this->_bufferedSignals[] = $this->_getProcessSignalInformationClone()->hydrate($signalInformation); + } + }else { + $this->_bufferedSignals[] = $this->_getProcessSignalInformationClone()->hydrate($signalInformation); + } + if ($this->_waitCount === 0) { + $this->_processBufferedSignals(); + }elseif ($this->_waitCount < 2) { + ++$this->_waitCount; + } + + return; + } + + public function waitForSignal(): SignalInterface { - pcntl_signal($signalNumber, $signalHandler); + $this->block(); + $signalNumber = pcntl_sigwaitinfo(array_keys($this->_signalHandlers), $signalInformation); + $this->handleSignal($signalNumber, $signalInformation); + $this->unBlock(); return $this; } public function block(): SignalInterface { - pcntl_sigprocmask(SIG_SETMASK, array_keys($this->_getBlockingSignalNumbers())); - $this->_isBlocked = true; + pcntl_sigprocmask(SIG_BLOCK, array_keys($this->_signalHandlers)); return $this; } public function unBlock(): SignalInterface { - $this->_isBlocked = false; - pcntl_sigprocmask(SIG_SETMASK, self::DEFAULT_BLOCKED_SIGNAL_NUMBERS); + pcntl_sigprocmask(SIG_UNBLOCK, array_keys($this->_signalHandlers)); return $this; } diff --git a/src/Process/Signal/HandlerInterface.php b/src/Process/Signal/HandlerInterface.php new file mode 100644 index 00000000..9786ad90 --- /dev/null +++ b/src/Process/Signal/HandlerInterface.php @@ -0,0 +1,9 @@ +_information === null) { + $this->_information = $information; + } + + return $this; + } + + public function getSignalNumber(): int + { + if (!isset($this->_information[self::SIGNAL_NUMBER])) { + throw new \RuntimeException('Signal number is not set.'); + } + + return $this->_information[self::SIGNAL_NUMBER]; + } + + public function getErrorNumber(): int + { + if (!isset($this->_information[self::ERROR_NUMBER])) { + throw new \RuntimeException('Error number is not set.'); + } + + return $this->_information[self::ERROR_NUMBER]; + } + + public function getSignalCode(): int + { + if (!isset($this->_information[self::SIGNAL_CODE])) { + throw new \RuntimeException('Signal code is not set.'); + } + + return $this->_information[self::SIGNAL_CODE]; + } + + public function hasExitValue(): bool + { + return isset($this->_information[self::EXIT_VALUE]) ? true : false; + } + + public function getExitValue(): int + { + if (!isset($this->_information[self::EXIT_VALUE])) { + throw new \LogicException('Exit value is not set.'); + } + + return $this->_information[self::EXIT_VALUE]; + } + + public function hasUserTimeConsumed(): bool + { + return isset($this->_information[self::USER_TIME_CONSUMED]) ? true : false; + } + + public function getUserTimeConsumed(): int + { + if (!isset($this->_information[self::USER_TIME_CONSUMED])) { + throw new \LogicException('User time consumed is not set.'); + } + + return $this->_information[self::USER_TIME_CONSUMED]; + } + + public function hasSystemTimeConsumed(): bool + { + return isset($this->_information[self::SYSTEM_TIME_CONSUMED]) ? true : false; + } + + public function getSystemTimeConsumed(): int + { + if (!isset($this->_information[self::SYSTEM_TIME_CONSUMED])) { + throw new \LogicException('System time consumed is not set.'); + } + + return $this->_information[self::SYSTEM_TIME_CONSUMED]; + } + + public function hasProcessId(): bool + { + return isset($this->_information[self::PROCESS_ID]) ? true : false; + } + + public function getProcessId(): int + { + if (!isset($this->_information[self::PROCESS_ID])) { + throw new \LogicException('Process ID is not set.'); + } + + return $this->_information[self::PROCESS_ID]; + } + + public function hasUserId(): bool + { + return isset($this->_information[self::USER_ID]) ? true : false; + } + + public function getUserId(): int + { + if (!isset($this->_information[self::USER_ID])) { + throw new \LogicException('User ID is not set.'); + } + + return $this->_information[self::USER_ID]; + } + + public function hasSegmentationFaultAddress(): bool + { + return isset($this->_information[self::SEGMENTATION_FAULT_ADDRESS]) ? true : false; + } + + public function getSegmentationFaultAddress(): int + { + if (!isset($this->_information[self::SEGMENTATION_FAULT_ADDRESS])) { + throw new \LogicException('Segmentation fault address is not set.'); + } + + return $this->_information[self::SEGMENTATION_FAULT_ADDRESS]; + } + + public function hasBandEvent(): bool + { + return isset($this->_information[self::BAND_EVENT]) ? true : false; + } + + public function getBandEvent(): int + { + if (!isset($this->_information[self::BAND_EVENT])) { + throw new \LogicException('Band event is not set.'); + } + + return $this->_information[self::BAND_EVENT]; + } + + public function hasFileDescriptorNumber(): bool + { + return isset($this->_information[self::FILE_DESCRIPTOR_NUMBER]) ? true : false; + } + + public function getFileDescriptorNumber(): int + { + if (!isset($this->_information[self::FILE_DESCRIPTOR_NUMBER])) { + throw new \LogicException('File descriptor number is not set.'); + } + + return $this->_information[self::FILE_DESCRIPTOR_NUMBER]; + } +} \ No newline at end of file diff --git a/src/Process/Signal/Information/AwareTrait.php b/src/Process/Signal/Information/AwareTrait.php new file mode 100644 index 00000000..22c21a3e --- /dev/null +++ b/src/Process/Signal/Information/AwareTrait.php @@ -0,0 +1,38 @@ +_create(InformationInterface::class, $processSignalInformation); + + return $this; + } + + protected function _getProcessSignalInformation(): InformationInterface + { + return $this->_read(InformationInterface::class); + } + + protected function _getProcessSignalInformationClone(): InformationInterface + { + return clone $this->_getProcessSignalInformation(); + } + + protected function _hasProcessSignalInformation(): bool + { + return $this->_exists(InformationInterface::class); + } + + protected function _unsetProcessSignalInformation(): self + { + $this->_delete(InformationInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Process/Signal/Information/Collection.php b/src/Process/Signal/Information/Collection.php new file mode 100644 index 00000000..30d11f6a --- /dev/null +++ b/src/Process/Signal/Information/Collection.php @@ -0,0 +1,61 @@ +_informationCollection[] = $information; + + return $this; + } + + public function unsetInformation(int $position): CollectionInterface + { + if (!isset($this->_informationCollection[$position])) { + throw new \LogicException("Information at position[$position] is not set."); + } + unset($this->_informationCollection[$position]); + + return $this; + } + + public function current(): InformationInterface + { + return $this->_informationCollection[$this->_position]; + } + + public function next() + { + return ++$this->_position; + } + + public function key(): int + { + return $this->_position; + } + + public function valid(): bool + { + return isset($this->_informationCollection[$this->_position]); + } + + public function rewind() + { + $position = reset($this->_informationCollection); + if ($position !== false) { + $this->_position = key($this->_informationCollection); + }else { + $this->_position = 0; + } + + return; + } +} \ No newline at end of file diff --git a/src/Process/Signal/Information/Collection/AwareTrait.php b/src/Process/Signal/Information/Collection/AwareTrait.php new file mode 100644 index 00000000..ef78aea5 --- /dev/null +++ b/src/Process/Signal/Information/Collection/AwareTrait.php @@ -0,0 +1,38 @@ +_create(CollectionInterface::class, $processSignalInformationCollection); + + return $this; + } + + protected function _getProcessSignalInformationCollection(): CollectionInterface + { + return $this->_read(CollectionInterface::class); + } + + protected function _getProcessSignalInformationCollectionClone(): CollectionInterface + { + return clone $this->_getProcessSignalInformationCollection(); + } + + protected function _hasProcessSignalInformationCollection(): bool + { + return $this->_exists(CollectionInterface::class); + } + + protected function _unsetProcessSignalInformationCollection(): self + { + $this->_delete(CollectionInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Process/Signal/Information/CollectionInterface.php b/src/Process/Signal/Information/CollectionInterface.php new file mode 100644 index 00000000..41f82c28 --- /dev/null +++ b/src/Process/Signal/Information/CollectionInterface.php @@ -0,0 +1,23 @@ + Date: Wed, 4 Apr 2018 14:49:34 -0500 Subject: [PATCH 12/44] - updates --- composer.json | 6 +++ composer.lock | 88 +++++++++++++++++++++++++++++++++- config/Process/Pool/Logger.yml | 2 +- config/Scheduler.yml | 2 +- config/Scheduler/Cache.yml | 2 +- config/Scheduler/Time.yml | 2 +- config/Service/Create.yml | 2 +- config/State/Service.yml | 2 +- config/dependencies.yml | 4 +- 9 files changed, 100 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 7e2a2030..0198cedf 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,12 @@ "email": "brad.wilson@neighborhoods.com" } ], + "repositories": [ + { + "type": "composer", + "url": "https://satis.neighborhoods.com" + } + ], "require": { "php": ">=7.1", "zendframework/zend-db": "^2.8", diff --git a/composer.lock b/composer.lock index e01b2e79..53301bb6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "3e1e0f86ef76f67966fad84644596f1b", + "content-hash": "45be7c4d5e572fff74a1fa6af70e50bc", "packages": [ { "name": "dragonmantank/cron-expression", @@ -55,6 +55,43 @@ ], "time": "2017-10-12T15:59:13+00:00" }, + { + "name": "neighborhoods/pylon", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:neighborhoods/pylon.git", + "reference": "c4670a6385b55c4b33d8bbd0b52f339d2ef201d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/neighborhoods/pylon/zipball/c4670a6385b55c4b33d8bbd0b52f339d2ef201d5", + "reference": "c4670a6385b55c4b33d8bbd0b52f339d2ef201d5", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "symfony/config": "~4.0.3", + "symfony/dependency-injection": "~4.0.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Neighborhoods\\Pylon\\": "src" + } + }, + "license": [ + "proprietary" + ], + "authors": [ + { + "name": "Brad Wilson", + "email": "brad.wilson@neighborhoods.com" + } + ], + "description": "Neighborhoods Pylon is a collection of useful, but most importantly, generic objects.", + "time": "2018-04-04T19:29:46+00:00" + }, { "name": "ocramius/package-versions", "version": "1.3.0", @@ -1160,6 +1197,50 @@ ], "time": "2017-10-19T19:58:43+00:00" }, + { + "name": "neighborhoods/scaffolding", + "version": "dev-master", + "source": { + "type": "git", + "url": "git@github.com:neighborhoods/Scaffolding.git", + "reference": "7284b70f88d47d03ef62d5310cd2484cf9a6418c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/7284b70f88d47d03ef62d5310cd2484cf9a6418c", + "reference": "7284b70f88d47d03ef62d5310cd2484cf9a6418c", + "shasum": "" + }, + "require": { + "neighborhoods/pylon": "dev-master", + "php": ">=7.1", + "phpunit/dbunit": "^3.0", + "phpunit/phpunit": "^6.4", + "symfony/config": "~4.0.3", + "symfony/dependency-injection": "~4.0.3", + "symfony/expression-language": "~4.0.3", + "symfony/filesystem": "~4.0.3", + "symfony/finder": "^4.0", + "symfony/yaml": "~4.0.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Neighborhoods\\Scaffolding\\": "src" + } + }, + "license": [ + "proprietary" + ], + "authors": [ + { + "name": "Neighborhoods.com", + "email": "brad.wilson@neighborhoods.com" + } + ], + "description": "Neighborhoods Scaffolding is meant to make the creation of contract testing easy and fast.", + "time": "2018-04-04T19:32:37+00:00" + }, { "name": "phar-io/manifest", "version": "1.0.1", @@ -2622,7 +2703,10 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "neighborhoods/pylon": 20, + "neighborhoods/scaffolding": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/config/Process/Pool/Logger.yml b/config/Process/Pool/Logger.yml index 4dbba75c..e55995fe 100644 --- a/config/Process/Pool/Logger.yml +++ b/config/Process/Pool/Logger.yml @@ -7,7 +7,7 @@ services: class: Neighborhoods\Kojo\Process\Pool\Logger calls: - [setIsEnabled, ['%process.pool.logger.is_enabled%']] - - [setTime, ['@nhds.toolkit.time']] + - [setTime, ['@neighborhoods.pylon.time']] - [setProcessIdPadding, ['%process.pool.logger.process_id_padding%']] - [setProcessPathPadding, ['%process.pool.logger.path_padding%']] process.pool.logger: diff --git a/config/Scheduler.yml b/config/Scheduler.yml index 37519813..f4316279 100644 --- a/config/Scheduler.yml +++ b/config/Scheduler.yml @@ -4,7 +4,7 @@ services: shared: false public: false calls: - - [setTime, ['@nhds.toolkit.time']] + - [setTime, ['@neighborhoods.pylon.time']] - [setSchedulerJobCollection, ['@data.job.collection.scheduler']] - [setSchedulerJobTypeCollection, ['@data.job.type.collection.scheduler']] - [setServiceCreateFactory, ['@service.create.factory']] diff --git a/config/Scheduler/Cache.yml b/config/Scheduler/Cache.yml index d6d8c61c..16a4ede3 100644 --- a/config/Scheduler/Cache.yml +++ b/config/Scheduler/Cache.yml @@ -5,6 +5,6 @@ services: calls: - [setSchedulerTime, ['@scheduler.time']] - [setCacheItemPoolRepository, ['@cache_item_pool.repository']] - - [setTime, ['@nhds.toolkit.time']] + - [setTime, ['@neighborhoods.pylon.time']] scheduler.cache: alias: neighborhoods.kojo.scheduler.cache \ No newline at end of file diff --git a/config/Scheduler/Time.yml b/config/Scheduler/Time.yml index 13e94154..21dbac0a 100644 --- a/config/Scheduler/Time.yml +++ b/config/Scheduler/Time.yml @@ -4,6 +4,6 @@ services: shared: true calls: - [setMinutesToScheduleAheadFor, [5]] - - [setTime, ['@nhds.toolkit.time']] + - [setTime, ['@neighborhoods.pylon.time']] scheduler.time: alias: neighborhoods.kojo.scheduler.time \ No newline at end of file diff --git a/config/Service/Create.yml b/config/Service/Create.yml index 75d72030..281dcf4f 100644 --- a/config/Service/Create.yml +++ b/config/Service/Create.yml @@ -4,6 +4,6 @@ services: shared: false calls: - [setTypeRepository, ['@type.repository']] - - [setTime, ['@nhds.toolkit.time']] + - [setTime, ['@neighborhoods.pylon.time']] service.create: alias: neighborhoods.kojo.service.create \ No newline at end of file diff --git a/config/State/Service.yml b/config/State/Service.yml index a4765369..b94a15b5 100644 --- a/config/State/Service.yml +++ b/config/State/Service.yml @@ -3,7 +3,7 @@ services: class: Neighborhoods\Kojo\State\Service shared: false calls: - - [setTime, ['@nhds.toolkit.time']] + - [setTime, ['@neighborhoods.pylon.time']] - [setTypeRepository, ['@type.repository']] state.service: alias: neighborhoods.kojo.state.service \ No newline at end of file diff --git a/config/dependencies.yml b/config/dependencies.yml index 282fac75..5590f94a 100644 --- a/config/dependencies.yml +++ b/config/dependencies.yml @@ -1,9 +1,9 @@ services: - nhds.toolkit.time: + neighborhoods.pylon.time: class: Neighborhoods\Toolkit\Time symfony.component.expressionlanguage.expressionlanguage: class: \Symfony\Component\ExpressionLanguage\ExpressionLanguage - nhds.kojo.symfony.component.console.application: + neighborhoods.kojo.symfony.component.console.application: public: true class: Symfony\Component\Console\Application calls: From b678cbb92ed4b93182282113fc2fbb5062c4e4ef Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 4 Apr 2018 14:51:02 -0500 Subject: [PATCH 13/44] - updates --- tests/Unit/Service/CreateInterfaceTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/Service/CreateInterfaceTest.php b/tests/Unit/Service/CreateInterfaceTest.php index d1e2cd77..40894b62 100644 --- a/tests/Unit/Service/CreateInterfaceTest.php +++ b/tests/Unit/Service/CreateInterfaceTest.php @@ -9,7 +9,7 @@ class CreateInterfaceTest extends Fixture\AbstractTest { public function testPick() { - $time = $this->_getTestContainerBuilder()->get('nhds.toolkit.time'); + $time = $this->_getTestContainerBuilder()->get('neighborhoods.pylon.time'); $create = $this->_getTestContainerBuilder()->get('service.create'); $create->setJobTypeCode('type_code_2'); $create->setWorkAtDateTime($time->getNow()); From ccc6c3be7beb0ac884d0ec1ba921b38a2f6be75c Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 4 Apr 2018 14:56:20 -0500 Subject: [PATCH 14/44] - updates --- bin/kojo | 2 +- src/CacheItemPool/Repository.php | 2 +- src/Console/CommandAbstract.php | 2 +- src/Data/AutoSchedule/Sqs.php | 2 +- src/Data/Job/Collection/Iterator.php | 2 +- src/Data/Job/Type/Collection/Iterator.php | 2 +- src/Db/Model/CollectionAbstract.php | 2 +- src/Foreman.php | 2 +- src/Maintainer.php | 2 +- src/Maintainer/Delete.php | 2 +- src/Message/Broker/BrokerAbstract.php | 2 +- src/Process/Collection.php | 2 +- src/Process/Collection/Iterator.php | 2 +- src/Process/Pool/Logger.php | 2 +- src/Process/Pool/StrategyAbstract.php | 2 +- src/Process/PoolAbstract.php | 2 +- src/Process/Signal.php | 2 +- src/Process/Signal/Information.php | 2 +- src/ProcessAbstract.php | 2 +- src/Redis/Factory.php | 2 +- src/Redis/Repository.php | 2 +- src/Scheduler.php | 2 +- src/Scheduler/Cache.php | 2 +- src/Scheduler/Time.php | 2 +- src/Selector.php | 2 +- src/Semaphore/Mutex/Flock.php | 2 +- src/Semaphore/Mutex/Redis.php | 2 +- src/Semaphore/Resource.php | 2 +- src/Semaphore/Resource/Factory.php | 2 +- src/Semaphore/Resource/Owner/Job.php | 2 +- src/Service/FactoryAbstract.php | 2 +- src/ServiceAbstract.php | 2 +- src/State/Service.php | 2 +- src/Type/Repository.php | 2 +- src/Type/ServiceAbstract.php | 2 +- src/Worker/BootstrapAbstract.php | 2 +- src/Worker/Job/Service.php | 2 +- src/Worker/Locator.php | 2 +- 38 files changed, 38 insertions(+), 38 deletions(-) diff --git a/bin/kojo b/bin/kojo index d8e0ed0b..486c5337 100755 --- a/bin/kojo +++ b/bin/kojo @@ -43,5 +43,5 @@ if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { $server->start(); exit(); } -$consoleApplication = $serviceContainer->getContainerBuilder()->get('nhds.kojo.symfony.component.console.application'); +$consoleApplication = $serviceContainer->getContainerBuilder()->get('neighborhoods.kojo.symfony.component.console.application'); $consoleApplication->run(); \ No newline at end of file diff --git a/src/CacheItemPool/Repository.php b/src/CacheItemPool/Repository.php index a407a5d6..f147b8b3 100644 --- a/src/CacheItemPool/Repository.php +++ b/src/CacheItemPool/Repository.php @@ -10,7 +10,7 @@ class Repository implements RepositoryInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Process\Registry\AwareTrait; use CacheItemPool\Factory\AwareTrait; protected $_cacheItemPoolCollection = []; diff --git a/src/Console/CommandAbstract.php b/src/Console/CommandAbstract.php index 5ccbfb9c..e56f5722 100644 --- a/src/Console/CommandAbstract.php +++ b/src/Console/CommandAbstract.php @@ -11,7 +11,7 @@ abstract class CommandAbstract extends Command { - use Strict\AwareTrait; + use Defensive\AwareTrait; const ARG_SERVICES_YML_FILE_PATH = 'services_yml_file_path'; const SPLASH_ART = [ '+------------------------------+', diff --git a/src/Data/AutoSchedule/Sqs.php b/src/Data/AutoSchedule/Sqs.php index f12c4d66..fd80cde2 100644 --- a/src/Data/AutoSchedule/Sqs.php +++ b/src/Data/AutoSchedule/Sqs.php @@ -8,7 +8,7 @@ class Sqs extends Model implements SqsInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; public function __construct() { diff --git a/src/Data/Job/Collection/Iterator.php b/src/Data/Job/Collection/Iterator.php index 4d2647c9..8de48ca3 100644 --- a/src/Data/Job/Collection/Iterator.php +++ b/src/Data/Job/Collection/Iterator.php @@ -9,7 +9,7 @@ class Iterator implements IteratorInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Collection\AwareTrait; protected $_models = []; diff --git a/src/Data/Job/Type/Collection/Iterator.php b/src/Data/Job/Type/Collection/Iterator.php index 447caeef..5e36e31a 100644 --- a/src/Data/Job/Type/Collection/Iterator.php +++ b/src/Data/Job/Type/Collection/Iterator.php @@ -9,7 +9,7 @@ class Iterator implements IteratorInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Collection\AwareTrait; function rewind() diff --git a/src/Db/Model/CollectionAbstract.php b/src/Db/Model/CollectionAbstract.php index 1de3cfff..76b77769 100644 --- a/src/Db/Model/CollectionAbstract.php +++ b/src/Db/Model/CollectionAbstract.php @@ -11,7 +11,7 @@ abstract class CollectionAbstract implements CollectionInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Model\AwareTrait; use Db\Connection\Container\AwareTrait; const PROP_SELECT = 'select'; diff --git a/src/Foreman.php b/src/Foreman.php index 3e6386da..75372ef9 100644 --- a/src/Foreman.php +++ b/src/Foreman.php @@ -26,7 +26,7 @@ class Foreman implements ForemanInterface use Update\Panic\Factory\AwareTrait; use Update\Crash\Factory\AwareTrait; use Update\Complete\Success\Factory\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; use Logger\AwareTrait; public function workWorker(): ForemanInterface diff --git a/src/Maintainer.php b/src/Maintainer.php index 8731eaf2..58959684 100644 --- a/src/Maintainer.php +++ b/src/Maintainer.php @@ -13,7 +13,7 @@ class Maintainer implements MaintainerInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use CrashDetection\AwareTrait; use Maintainer\Delete\AwareTrait; use Semaphore\AwareTrait; diff --git a/src/Maintainer/Delete.php b/src/Maintainer/Delete.php index 46b36d2a..74e6949c 100644 --- a/src/Maintainer/Delete.php +++ b/src/Maintainer/Delete.php @@ -10,7 +10,7 @@ class Delete implements DeleteInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Semaphore\AwareTrait; use Semaphore\Resource\Factory\AwareTrait; use Job\Collection\Delete\AwareTrait; diff --git a/src/Message/Broker/BrokerAbstract.php b/src/Message/Broker/BrokerAbstract.php index 2ec8a878..a6f5468c 100644 --- a/src/Message/Broker/BrokerAbstract.php +++ b/src/Message/Broker/BrokerAbstract.php @@ -8,7 +8,7 @@ abstract class BrokerAbstract implements BrokerInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Logger\AwareTrait; protected $_publishChannelName; protected $_subscriptionChannelName; diff --git a/src/Process/Collection.php b/src/Process/Collection.php index b79c040b..95fd08c2 100644 --- a/src/Process/Collection.php +++ b/src/Process/Collection.php @@ -9,7 +9,7 @@ class Collection implements CollectionInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_APPLIED_POOL = 'applied_pool'; protected $_processPrototypes = []; diff --git a/src/Process/Collection/Iterator.php b/src/Process/Collection/Iterator.php index 451c9b5f..2e6afc11 100644 --- a/src/Process/Collection/Iterator.php +++ b/src/Process/Collection/Iterator.php @@ -9,7 +9,7 @@ class Iterator implements IteratorInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Collection\AwareTrait; protected $processPrototypes = []; diff --git a/src/Process/Pool/Logger.php b/src/Process/Pool/Logger.php index 4b92313b..123ef266 100644 --- a/src/Process/Pool/Logger.php +++ b/src/Process/Pool/Logger.php @@ -11,7 +11,7 @@ class Logger extends Log\AbstractLogger implements LoggerInterface { use Time\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; const PAD_PID = 6; const PAD_PATH = 50; const PROP_IS_ENABLED = 'is_enabled'; diff --git a/src/Process/Pool/StrategyAbstract.php b/src/Process/Pool/StrategyAbstract.php index 356ea0ca..750ca508 100644 --- a/src/Process/Pool/StrategyAbstract.php +++ b/src/Process/Pool/StrategyAbstract.php @@ -9,7 +9,7 @@ abstract class StrategyAbstract implements StrategyInterface { use AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; use Logger\AwareTrait; use Collection\AwareTrait; diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index afc05c74..b6d0cfef 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -9,7 +9,7 @@ abstract class PoolAbstract implements PoolInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Process\Pool\Logger\AwareTrait; use Process\Pool\Strategy\AwareTrait; use Process\AwareTrait; diff --git a/src/Process/Signal.php b/src/Process/Signal.php index 6c8195b2..9b706216 100644 --- a/src/Process/Signal.php +++ b/src/Process/Signal.php @@ -9,7 +9,7 @@ class Signal implements SignalInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Process\Signal\Information\AwareTrait; protected $_waitCount = 0; protected $_signalHandlers = []; diff --git a/src/Process/Signal/Information.php b/src/Process/Signal/Information.php index 745c6e5b..0d50a253 100644 --- a/src/Process/Signal/Information.php +++ b/src/Process/Signal/Information.php @@ -7,7 +7,7 @@ class Information implements InformationInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; protected $_information; public function hydrate(array $information): InformationInterface diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index 620574d9..242701b0 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -13,7 +13,7 @@ abstract class ProcessAbstract implements ProcessInterface use Process\Pool\AwareTrait; use Process\Strategy\AwareTrait; use Process\Signal\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; use Logger\AwareTrait; const PROP_IS_PROCESS_TITLE_SET = 'is_process_title_set'; const PROP_TITLE_PREFIX = 'title_prefix'; diff --git a/src/Redis/Factory.php b/src/Redis/Factory.php index 3d38cd55..08405ab2 100644 --- a/src/Redis/Factory.php +++ b/src/Redis/Factory.php @@ -8,7 +8,7 @@ class Factory extends FactoryAbstract implements FactoryInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; protected $_options = []; public function create(): \Redis diff --git a/src/Redis/Repository.php b/src/Redis/Repository.php index 593d4bf6..d31f30ce 100644 --- a/src/Redis/Repository.php +++ b/src/Redis/Repository.php @@ -9,7 +9,7 @@ class Repository implements RepositoryInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Redis\Factory\AwareTrait; use Process\Registry\AwareTrait; protected $_redisCollection = []; diff --git a/src/Scheduler.php b/src/Scheduler.php index 67a964b9..27af4e45 100644 --- a/src/Scheduler.php +++ b/src/Scheduler.php @@ -15,7 +15,7 @@ class Scheduler implements SchedulerInterface use Job\Collection\Scheduler\AwareTrait; use Job\Type\Collection\Scheduler\AwareTrait; use Time\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; use Api\V1\Service\Create\Factory\AwareTrait; use Semaphore\Resource\Factory\AwareTrait; diff --git a/src/Scheduler/Cache.php b/src/Scheduler/Cache.php index a425f485..eb9f6ddc 100644 --- a/src/Scheduler/Cache.php +++ b/src/Scheduler/Cache.php @@ -10,7 +10,7 @@ class Cache implements CacheInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Scheduler\Time\AwareTrait; use Time\AwareTrait; use CacheItemPool\Repository\AwareTrait; diff --git a/src/Scheduler/Time.php b/src/Scheduler/Time.php index a2ce2920..848bfac0 100644 --- a/src/Scheduler/Time.php +++ b/src/Scheduler/Time.php @@ -8,7 +8,7 @@ class Time implements TimeInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Toolkit\Time\AwareTrait; const PROP_MINUTES_SCHEDULED_AHEAD_FOR = 'minutes_scheduled_ahead_for'; const PROP_REFERENCE_DISTANCE_DATE_TIME = 'reference_distance_date_time'; diff --git a/src/Selector.php b/src/Selector.php index bb1620ba..7d2e4c20 100644 --- a/src/Selector.php +++ b/src/Selector.php @@ -12,7 +12,7 @@ class Selector implements SelectorInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Broker\AwareTrait; use Job\AwareTrait; use Semaphore\AwareTrait; diff --git a/src/Semaphore/Mutex/Flock.php b/src/Semaphore/Mutex/Flock.php index b018fe5a..bfbd82bd 100644 --- a/src/Semaphore/Mutex/Flock.php +++ b/src/Semaphore/Mutex/Flock.php @@ -12,7 +12,7 @@ class Flock extends MutexAbstract { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Filesystem\AwareTrait; use Logger\AwareTrait; const PROP_DIRECTORY_PATH_PREFIX = 'directory_path_prefix'; diff --git a/src/Semaphore/Mutex/Redis.php b/src/Semaphore/Mutex/Redis.php index 6f313eff..fd2afd8f 100644 --- a/src/Semaphore/Mutex/Redis.php +++ b/src/Semaphore/Mutex/Redis.php @@ -12,7 +12,7 @@ class Redis extends MutexAbstract implements RedisInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Logger\AwareTrait; use Process\Registry\AwareTrait; use Repository\AwareTrait; diff --git a/src/Semaphore/Resource.php b/src/Semaphore/Resource.php index e8e2eb82..097f1fbe 100644 --- a/src/Semaphore/Resource.php +++ b/src/Semaphore/Resource.php @@ -9,7 +9,7 @@ class Resource implements ResourceInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_RESOURCE_OWNER = 'resource_owner'; const PROP_RESOURCE_NAME = 'resource_name'; const PROP_RESOURCE_PATH = 'resource_path'; diff --git a/src/Semaphore/Resource/Factory.php b/src/Semaphore/Resource/Factory.php index 1afcf3e5..ad2efa49 100644 --- a/src/Semaphore/Resource/Factory.php +++ b/src/Semaphore/Resource/Factory.php @@ -13,7 +13,7 @@ class Factory extends FactoryAbstract implements FactoryInterface use Semaphore\Resource\AwareTrait; use Semaphore\Mutex\AwareTrait; use Semaphore\Resource\Owner\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; public function create(): Semaphore\ResourceInterface { diff --git a/src/Semaphore/Resource/Owner/Job.php b/src/Semaphore/Resource/Owner/Job.php index 483c8b5b..29cd60fe 100644 --- a/src/Semaphore/Resource/Owner/Job.php +++ b/src/Semaphore/Resource/Owner/Job.php @@ -9,7 +9,7 @@ class Job implements JobInterface { use Data\Job\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_RESOURCE_NAME = 'resource_name'; const PROP_RESOURCE_PATH = 'resource_path'; diff --git a/src/Service/FactoryAbstract.php b/src/Service/FactoryAbstract.php index 136c4d1f..a8d0f81a 100644 --- a/src/Service/FactoryAbstract.php +++ b/src/Service/FactoryAbstract.php @@ -7,7 +7,7 @@ abstract class FactoryAbstract implements FactoryInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_FACTORY_NAME = 'factory_name'; public function setName(string $factoryName): FactoryInterface diff --git a/src/ServiceAbstract.php b/src/ServiceAbstract.php index 1566d614..2f0b5476 100644 --- a/src/ServiceAbstract.php +++ b/src/ServiceAbstract.php @@ -8,7 +8,7 @@ abstract class ServiceAbstract implements ServiceInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Job\AwareTrait; use State\Service\AwareTrait; const PROP_SAVED = 'saved'; diff --git a/src/State/Service.php b/src/State/Service.php index eb22db46..a1fd720f 100644 --- a/src/State/Service.php +++ b/src/State/Service.php @@ -11,7 +11,7 @@ class Service implements ServiceInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Job\AwareTrait; use Time\AwareTrait; use Type\Repository\AwareTrait; diff --git a/src/Type/Repository.php b/src/Type/Repository.php index c5fa1d73..cd1629e0 100644 --- a/src/Type/Repository.php +++ b/src/Type/Repository.php @@ -9,7 +9,7 @@ class Repository implements RepositoryInterface { - use Strict\AwareTrait; + use Defensive\AwareTrait; use Job\Type\AwareTrait; protected $_jobTypes = []; diff --git a/src/Type/ServiceAbstract.php b/src/Type/ServiceAbstract.php index 39c13ba7..fe7839a1 100644 --- a/src/Type/ServiceAbstract.php +++ b/src/Type/ServiceAbstract.php @@ -10,7 +10,7 @@ abstract class ServiceAbstract implements Type\ServiceInterface { use Job\Type\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_SAVED = 'saved'; public function save(): ServiceInterface diff --git a/src/Worker/BootstrapAbstract.php b/src/Worker/BootstrapAbstract.php index 80ff2310..08738346 100644 --- a/src/Worker/BootstrapAbstract.php +++ b/src/Worker/BootstrapAbstract.php @@ -11,7 +11,7 @@ abstract class BootstrapAbstract implements BootstrapInterface { use Container\AwareTrait; use Foreman\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_PDO = 'pdo'; abstract public function instantiate(): BootstrapInterface; diff --git a/src/Worker/Job/Service.php b/src/Worker/Job/Service.php index 34e7d9a8..e1420f5e 100644 --- a/src/Worker/Job/Service.php +++ b/src/Worker/Job/Service.php @@ -17,7 +17,7 @@ class Service implements ServiceInterface use Update\Complete\Success\Factory\AwareTrait; use Update\Complete\Failed\Factory\AwareTrait; use Api\V1\Service\Create\Factory\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; const PROP_REQUEST = 'request'; const PROP_RETRY_DATE_TIME = 'retry_date_time'; const REQUEST_RETRY = 'retry'; diff --git a/src/Worker/Locator.php b/src/Worker/Locator.php index b965af54..ab68285a 100644 --- a/src/Worker/Locator.php +++ b/src/Worker/Locator.php @@ -9,7 +9,7 @@ class Locator implements LocatorInterface { use Job\AwareTrait; - use Strict\AwareTrait; + use Defensive\AwareTrait; public function getCallable(): callable { From 194eb63b86677d4d0fb2f8a82eb908691c5121d1 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 4 Apr 2018 15:06:05 -0500 Subject: [PATCH 15/44] - updates --- composer.lock | 8 ++++---- src/Process/PoolInterface.php | 2 +- src/Process/Registry/AwareTrait.php | 2 +- src/Scheduler/Time.php | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index 53301bb6..1e2f2d63 100644 --- a/composer.lock +++ b/composer.lock @@ -1203,12 +1203,12 @@ "source": { "type": "git", "url": "git@github.com:neighborhoods/Scaffolding.git", - "reference": "7284b70f88d47d03ef62d5310cd2484cf9a6418c" + "reference": "267db7e04a19b64b4261e3baedbc2dcb40311550" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/7284b70f88d47d03ef62d5310cd2484cf9a6418c", - "reference": "7284b70f88d47d03ef62d5310cd2484cf9a6418c", + "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/267db7e04a19b64b4261e3baedbc2dcb40311550", + "reference": "267db7e04a19b64b4261e3baedbc2dcb40311550", "shasum": "" }, "require": { @@ -1239,7 +1239,7 @@ } ], "description": "Neighborhoods Scaffolding is meant to make the creation of contract testing easy and fast.", - "time": "2018-04-04T19:32:37+00:00" + "time": "2018-04-04T19:54:12+00:00" }, { "name": "phar-io/manifest", diff --git a/src/Process/PoolInterface.php b/src/Process/PoolInterface.php index 7b01df25..490aaf4a 100644 --- a/src/Process/PoolInterface.php +++ b/src/Process/PoolInterface.php @@ -5,7 +5,7 @@ use Neighborhoods\Kojo\Process\Pool\StrategyInterface; use Neighborhoods\Kojo\ProcessInterface; -use Neighborhoods\Jobs\Process\Signal\HandlerInterface; +use Neighborhoods\Kojo\Process\Signal\HandlerInterface; interface PoolInterface extends HandlerInterface { diff --git a/src/Process/Registry/AwareTrait.php b/src/Process/Registry/AwareTrait.php index 127b2ea3..20e74faa 100644 --- a/src/Process/Registry/AwareTrait.php +++ b/src/Process/Registry/AwareTrait.php @@ -16,7 +16,7 @@ public function setProcessRegistry(RegistryInterface $registry): self public function hasProcessRegistry(): bool { - $this->_exists(RegistryInterface::class); + return $this->_exists(RegistryInterface::class); } protected function _getProcessRegistry(): RegistryInterface diff --git a/src/Scheduler/Time.php b/src/Scheduler/Time.php index 848bfac0..a74209aa 100644 --- a/src/Scheduler/Time.php +++ b/src/Scheduler/Time.php @@ -9,7 +9,7 @@ class Time implements TimeInterface { use Defensive\AwareTrait; - use Toolkit\Time\AwareTrait; + use Pylon\Time\AwareTrait; const PROP_MINUTES_SCHEDULED_AHEAD_FOR = 'minutes_scheduled_ahead_for'; const PROP_REFERENCE_DISTANCE_DATE_TIME = 'reference_distance_date_time'; From 6f22d8a3ba7f51816755f5aa2060afa0f6223d87 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Sat, 7 Apr 2018 08:55:23 -0500 Subject: [PATCH 16/44] - signal information factory - signal information - logger set on the signal class - toolkit > pylon - removed process pool started event in favor of asynchronous signals - removed information collection because custom iterators aren't behaving IRQ safely - updated process abstract to manage signal and pool installation - fixed tests DI resource path --- bin/kojo | 3 +- composer.lock | 62 +++++----- config/Process/Signal.yml | 3 + config/Process/Signal/Information.yml | 8 ++ config/Process/Signal/Information/Factory.yml | 10 ++ config/dependencies.yml | 2 +- config/root.yml | 2 + src/Process/Forked.php | 33 +----- src/Process/Pool.php | 110 +++++------------- src/Process/Pool/Logger.php | 1 + src/Process/Pool/Server.php | 14 +-- src/Process/Pool/Strategy.php | 3 +- src/Process/PoolAbstract.php | 6 +- src/Process/PoolInterface.php | 6 - src/Process/Root.php | 2 +- src/Process/Signal.php | 35 ++++-- src/Process/Signal/Information.php | 3 - src/Process/Signal/Information/Collection.php | 61 ---------- .../Information/Collection/AwareTrait.php | 38 ------ .../Information/CollectionInterface.php | 23 ---- src/Process/Signal/Information/Factory.php | 20 ++++ .../Signal/Information/Factory/AwareTrait.php | 38 ++++++ .../Signal/Information/FactoryInterface.php | 11 ++ src/Process/SignalInterface.php | 4 + src/ProcessAbstract.php | 48 ++++---- src/ProcessInterface.php | 7 +- tests/config/root.yml | 2 +- 27 files changed, 227 insertions(+), 328 deletions(-) create mode 100644 config/Process/Signal/Information.yml create mode 100644 config/Process/Signal/Information/Factory.yml delete mode 100644 src/Process/Signal/Information/Collection.php delete mode 100644 src/Process/Signal/Information/Collection/AwareTrait.php delete mode 100644 src/Process/Signal/Information/CollectionInterface.php create mode 100644 src/Process/Signal/Information/Factory.php create mode 100644 src/Process/Signal/Information/Factory/AwareTrait.php create mode 100644 src/Process/Signal/Information/FactoryInterface.php diff --git a/bin/kojo b/bin/kojo index 486c5337..bc921856 100755 --- a/bin/kojo +++ b/bin/kojo @@ -44,4 +44,5 @@ if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { exit(); } $consoleApplication = $serviceContainer->getContainerBuilder()->get('neighborhoods.kojo.symfony.component.console.application'); -$consoleApplication->run(); \ No newline at end of file +$consoleApplication->run(); +return; \ No newline at end of file diff --git a/composer.lock b/composer.lock index 1e2f2d63..c3aeb763 100644 --- a/composer.lock +++ b/composer.lock @@ -8,23 +8,23 @@ "packages": [ { "name": "dragonmantank/cron-expression", - "version": "v2.0.0", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "8a84aee649c3a3ba03a721c1fb080e08dfbcd68b" + "reference": "3f00985deec8df53d4cc1e5c33619bda1ee309a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/8a84aee649c3a3ba03a721c1fb080e08dfbcd68b", - "reference": "8a84aee649c3a3ba03a721c1fb080e08dfbcd68b", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/3f00985deec8df53d4cc1e5c33619bda1ee309a5", + "reference": "3f00985deec8df53d4cc1e5c33619bda1ee309a5", "shasum": "" }, "require": { "php": ">=7.0.0" }, "require-dev": { - "phpunit/phpunit": "~5.7" + "phpunit/phpunit": "~6.4" }, "type": "library", "autoload": { @@ -53,7 +53,7 @@ "cron", "schedule" ], - "time": "2017-10-12T15:59:13+00:00" + "time": "2018-04-06T15:51:55+00:00" }, { "name": "neighborhoods/pylon", @@ -61,12 +61,12 @@ "source": { "type": "git", "url": "git@github.com:neighborhoods/pylon.git", - "reference": "c4670a6385b55c4b33d8bbd0b52f339d2ef201d5" + "reference": "e3c5911395e6f9b2a68b79d3e1d985be7e76074d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neighborhoods/pylon/zipball/c4670a6385b55c4b33d8bbd0b52f339d2ef201d5", - "reference": "c4670a6385b55c4b33d8bbd0b52f339d2ef201d5", + "url": "https://api.github.com/repos/neighborhoods/pylon/zipball/e3c5911395e6f9b2a68b79d3e1d985be7e76074d", + "reference": "e3c5911395e6f9b2a68b79d3e1d985be7e76074d", "shasum": "" }, "require": { @@ -90,7 +90,7 @@ } ], "description": "Neighborhoods Pylon is a collection of useful, but most importantly, generic objects.", - "time": "2018-04-04T19:29:46+00:00" + "time": "2018-04-04T21:32:23+00:00" }, { "name": "ocramius/package-versions", @@ -402,7 +402,7 @@ }, { "name": "symfony/cache", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", @@ -471,7 +471,7 @@ }, { "name": "symfony/config", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/config.git", @@ -533,7 +533,7 @@ }, { "name": "symfony/console", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -601,7 +601,7 @@ }, { "name": "symfony/dependency-injection", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", @@ -672,7 +672,7 @@ }, { "name": "symfony/expression-language", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", @@ -722,7 +722,7 @@ }, { "name": "symfony/filesystem", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -830,7 +830,7 @@ }, { "name": "symfony/yaml", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", @@ -1203,12 +1203,12 @@ "source": { "type": "git", "url": "git@github.com:neighborhoods/Scaffolding.git", - "reference": "267db7e04a19b64b4261e3baedbc2dcb40311550" + "reference": "2e113f9aafd93886842ba250a3729545a78ccbb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/267db7e04a19b64b4261e3baedbc2dcb40311550", - "reference": "267db7e04a19b64b4261e3baedbc2dcb40311550", + "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/2e113f9aafd93886842ba250a3729545a78ccbb3", + "reference": "2e113f9aafd93886842ba250a3729545a78ccbb3", "shasum": "" }, "require": { @@ -1239,7 +1239,7 @@ } ], "description": "Neighborhoods Scaffolding is meant to make the creation of contract testing easy and fast.", - "time": "2018-04-04T19:54:12+00:00" + "time": "2018-04-06T19:54:09+00:00" }, { "name": "phar-io/manifest", @@ -1612,16 +1612,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.0", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { @@ -1671,7 +1671,7 @@ "testing", "xunit" ], - "time": "2017-12-06T09:29:45+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2563,16 +2563,16 @@ }, { "name": "symfony/finder", - "version": "v4.0.7", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1" + "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/c72995d9f5999b3fcdd8660c0c9690243252e1e1", - "reference": "c72995d9f5999b3fcdd8660c0c9690243252e1e1", + "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", + "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", "shasum": "" }, "require": { @@ -2608,7 +2608,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-04-02T09:52:41+00:00" + "time": "2018-04-04T05:10:37+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/Process/Signal.yml b/config/Process/Signal.yml index 6120d209..d7e0d701 100644 --- a/config/Process/Signal.yml +++ b/config/Process/Signal.yml @@ -3,6 +3,9 @@ services: class: Neighborhoods\Kojo\Process\Signal public: false shared: true + calls: + - [setLogger, ['@process.pool.logger']] + - [setProcessSignalInformationFactory, ['@process.signal.information.factory']] process.signal: alias: neighborhoods.kojo.process.signal public: false \ No newline at end of file diff --git a/config/Process/Signal/Information.yml b/config/Process/Signal/Information.yml new file mode 100644 index 00000000..10335c39 --- /dev/null +++ b/config/Process/Signal/Information.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.process.signal.information: + class: Neighborhoods\Kojo\Process\Signal\Information + public: false + shared: false + process.signal.information: + public: false + alias: neighborhoods.kojo.process.signal.information \ No newline at end of file diff --git a/config/Process/Signal/Information/Factory.yml b/config/Process/Signal/Information/Factory.yml new file mode 100644 index 00000000..2c7b68cc --- /dev/null +++ b/config/Process/Signal/Information/Factory.yml @@ -0,0 +1,10 @@ +services: + neighborhoods.kojo.process.signal.information.factory: + class: Neighborhoods\Kojo\Process\Signal\Information\Factory + public: false + shared: false + calls: + - [setProcessSignalInformation, ['@process.signal.information']] + process.signal.information.factory: + public: false + alias: neighborhoods.kojo.process.signal.information.factory \ No newline at end of file diff --git a/config/dependencies.yml b/config/dependencies.yml index 5590f94a..f0f83a1c 100644 --- a/config/dependencies.yml +++ b/config/dependencies.yml @@ -1,6 +1,6 @@ services: neighborhoods.pylon.time: - class: Neighborhoods\Toolkit\Time + class: Neighborhoods\Pylon\Time symfony.component.expressionlanguage.expressionlanguage: class: \Symfony\Component\ExpressionLanguage\ExpressionLanguage neighborhoods.kojo.symfony.component.console.application: diff --git a/config/root.yml b/config/root.yml index c42dae7f..d92a15c7 100644 --- a/config/root.yml +++ b/config/root.yml @@ -53,6 +53,7 @@ imports: - { resource: Service/Update/Complete/Success/Factory.yml } - { resource: Semaphore/Resource/Factory.yml } - { resource: Process/Pool/Factory.yml } + - { resource: Process/Signal/Information/Factory.yml } - { resource: Redis/Factory.yml } # Services. @@ -78,6 +79,7 @@ imports: # Process. - { resource: Process.yml } - { resource: Process/Signal.yml } + - { resource: Process/Signal/Information.yml } - { resource: Process/Root.yml } - { resource: Process/Registry.yml } - { resource: Process/Job.yml } diff --git a/src/Process/Forked.php b/src/Process/Forked.php index 427a34fb..fda1d53d 100644 --- a/src/Process/Forked.php +++ b/src/Process/Forked.php @@ -9,7 +9,6 @@ abstract class Forked extends ProcessAbstract implements ProcessInterface { - use Process\Pool\Factory\AwareTrait; const FORK_FAILURE_CODE = -1; const PROP_HAS_FORKED = 'has_forked'; @@ -25,38 +24,14 @@ public function start(): ProcessInterface }else { // This is executed in the child process. $this->_initialize(); - $this->_removeParentProcessPool(); - $this->_startProcessPool(); + $this->_getProcessSignal()->decrementWaitCount(); + $this->_getProcessPool()->start(); + $this->_run(); + $this->exit(0); } return $this; } - protected function _removeParentProcessPool(): Forked - { - $this->_getProcessPool()->emptyChildProcesses(); - $this->_unsetProcessPool(); - - return $this; - } - - protected function _startProcessPool(): Forked - { - $this->setProcessPool($this->_getProcessPoolFactory()->create()); - $this->_getProcessPool()->setProcess($this); - $this->_getProcessPool()->start(); - - return $this; - } - - public function processPoolStarted(): ProcessInterface - { - $this->_getProcessSignal()->unBlock(); - $this->_run(); - $this->exit(0); - - return $this; - } - abstract protected function _run(): Forked; } \ No newline at end of file diff --git a/src/Process/Pool.php b/src/Process/Pool.php index dee15f11..2e0a75f2 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -9,49 +9,26 @@ class Pool extends PoolAbstract implements PoolInterface { - const SIGNAL_NUMBER = 'signo'; - const PROP_STARTED = 'started'; - protected $_signalInformation = []; - protected $_childProcesses = []; - protected $_waitSignals = [ - SIGCHLD, - SIGALRM, - SIGTERM, - SIGINT, - SIGHUP, - SIGQUIT, - SIGABRT, - ]; + const PROP_STARTED = 'started'; + protected $_childProcesses = []; public function start(): PoolInterface { $this->_create(self::PROP_STARTED, true); $this->_initialize(); - $this->getProcess()->processPoolStarted(); return $this; } - public function waitForSignal(): PoolInterface + public function handleSignal(InformationInterface $signalInformation): HandlerInterface { - $this->_getLogger()->info("Waiting for signal..."); - $this->_signalInformation = []; - pcntl_sigwaitinfo($this->_waitSignals, $this->_signalInformation); - $signalNumber = $this->_signalInformation[self::SIGNAL_NUMBER]; - $this->_getLogger()->info("Received signal number[$signalNumber]."); + $signalNumber = $signalInformation->getSignalNumber(); switch ($signalNumber) { case SIGCHLD: - $this->childExitSignal(); + $this->_childExitSignal($signalInformation); break; case SIGALRM: - $this->alarmSignal(); - break; - case SIGTERM: - case SIGINT: - case SIGHUP: - case SIGQUIT: - case SIGABRT: - $this->getProcess()->receivedSignal($signalNumber, $this->_signalInformation); + $this->_alarmSignal($signalInformation); break; default: throw new \UnexpectedValueException("Unexpected signal number [$signalNumber]."); @@ -60,37 +37,37 @@ public function waitForSignal(): PoolInterface return $this; } - public function handleSignal(InformationInterface $signalInformation): HandlerInterface + protected function _childExitSignal(InformationInterface $information): PoolInterface { - $this->_getLogger()->info("Received signal number[$signalNumber]."); - switch ($signalNumber) { - case SIGCHLD: - $this->childExitSignal($signalInformation); - break; - case SIGALRM: - $this->alarmSignal(); - break; - case SIGTERM: - case SIGINT: - case SIGHUP: - case SIGQUIT: - case SIGABRT: - $this->getProcess()->receivedSignal($signalNumber, $this->_signalInformation); - break; - default: - throw new \UnexpectedValueException("Unexpected signal number [$signalNumber]."); + $childProcessId = $information->getProcessId(); + if (isset($this->_childProcesses[$childProcessId])) { + $childProcessExitCode = $information->getExitValue(); + $childProcess = $this->getChildProcess($information->getProcessId())->setExitCode($childProcessExitCode); + $this->_getProcessPoolStrategy()->childProcessExited($childProcess); + $this->_validateAlarm(); + $this->_getProcessPoolStrategy()->currentPendingChildExitsCompleted(); + }else { + $processId = $this->_getProcess()->getProcessId(); + $this->_getLogger()->notice("Child process[$childProcessId] is not in the pool for process[$processId]."); } return $this; } - public function childExitSignal(InformationInterface $information): PoolInterface + public function freeChildProcess(int $childProcessId): PoolInterface { - $childProcessExitCode = pcntl_wexitstatus($status); - $childProcess = $this->getChildProcess($childProcessId)->setExitCode($childProcessExitCode); - $this->_getProcessPoolStrategy()->childProcessExited($childProcess); - $this->_validateAlarm(); - $this->_getProcessPoolStrategy()->currentPendingChildExitsCompleted(); + if (isset($this->_childProcesses[$childProcessId])) { + if ($this->_childProcesses[$childProcessId] instanceof ProcessInterface) { + $typeCode = $this->_childProcesses[$childProcessId]->getTypeCode(); + $this->_getLogger()->info("Freeing child process related to Process[$childProcessId][$typeCode]."); + unset($this->_childProcesses[$childProcessId]); + }else { + $message = "Process associated to Process[$childProcessId] is not an expected type."; + throw new \UnexpectedValueException($message); + } + }else { + throw new \LogicException("Process associated to Process[$childProcessId] is not in the process pool."); + } return $this; } @@ -100,15 +77,6 @@ public function getCountOfChildProcesses(): int return count($this->_childProcesses); } - protected function _processControlWaitError() - { - $waitErrorString = var_export(pcntl_strerror(pcntl_get_last_error()), true); - $this->_getLogger()->emergency('Received wait error, error string: "' . $waitErrorString . '".'); - $signalInformation = var_export($this->_signalInformation, true); - $this->_getLogger()->emergency('Received wait error, signal information: ' . $signalInformation); - throw new \RuntimeException('Unrecoverable process control wait error.'); - } - public function addChildProcess(ProcessInterface $childProcess): PoolInterface { $this->_getProcessSignal()->incrementWaitCount(); @@ -134,24 +102,6 @@ public function getChildProcess(int $childProcessId): ProcessInterface return $this->_childProcesses[$childProcessId]; } - public function freeChildProcess(int $childProcessId): PoolInterface - { - if (isset($this->_childProcesses[$childProcessId])) { - if ($this->_childProcesses[$childProcessId] instanceof ProcessInterface) { - $typeCode = $this->_childProcesses[$childProcessId]->getTypeCode(); - $this->_getLogger()->info("Freeing child process related to Process[$childProcessId][$typeCode]."); - unset($this->_childProcesses[$childProcessId]); - }else { - $message = "Process associated to Process[$childProcessId] is not an expected type."; - throw new \UnexpectedValueException($message); - } - }else { - throw new \LogicException("Process associated to Process[$childProcessId] is not in the process pool."); - } - - return $this; - } - public function terminateChildProcesses(): PoolInterface { $this->_getProcessSignal()->block(); diff --git a/src/Process/Pool/Logger.php b/src/Process/Pool/Logger.php index 123ef266..022c0fe8 100644 --- a/src/Process/Pool/Logger.php +++ b/src/Process/Pool/Logger.php @@ -7,6 +7,7 @@ use Neighborhoods\Pylon\Time; use Neighborhoods\Kojo\ProcessInterface; use Neighborhoods\Pylon\Data\Property\Defensive; +use Psr\Log\LogLevel; class Logger extends Log\AbstractLogger implements LoggerInterface { diff --git a/src/Process/Pool/Server.php b/src/Process/Pool/Server.php index 9c8b7593..fde9abc6 100644 --- a/src/Process/Pool/Server.php +++ b/src/Process/Pool/Server.php @@ -24,9 +24,10 @@ public function start(): ProcessInterface $this->_getLogger()->info('Starting process pool server...'); if ($this->_getSemaphore()->testAndSetLock($this->_getServerSemaphoreResource())) { $this->_getLogger()->info('Process pool server started.'); - $this->setProcessPool($this->_getProcessPoolFactory()->create()); - $this->_getProcessPool()->setProcess($this); $this->_getProcessPool()->start(); + while (true) { + $this->_getProcessSignal()->waitForSignal(); + } }else { $this->_getLogger()->info('Cannot obtain process pool server mutex. Quitting.'); } @@ -38,13 +39,4 @@ protected function _getServerSemaphoreResource(): Semaphore\ResourceInterface { return $this->_getSemaphoreResource(self::SERVER_SEMAPHORE_RESOURCE_NAME); } - - public function processPoolStarted(): ProcessInterface - { - while (true) { - $this->_getProcessPool()->waitForSignal(); - } - - return $this; - } } \ No newline at end of file diff --git a/src/Process/Pool/Strategy.php b/src/Process/Pool/Strategy.php index 145a2d27..e8306e69 100644 --- a/src/Process/Pool/Strategy.php +++ b/src/Process/Pool/Strategy.php @@ -18,7 +18,8 @@ public function childProcessExited(ProcessInterface $process): StrategyInterface }elseif ($process instanceof ListenerInterface) { $this->_listenerProcessExited($process); }else { - throw new \UnexpectedValueException('Unexpected process class.'); + $className = get_class($process); + throw new \UnexpectedValueException("Unexpected process class[$className]."); } return $this; diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index b6d0cfef..da8f7412 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -4,6 +4,7 @@ namespace Neighborhoods\Kojo\Process; use Neighborhoods\Kojo\Process; +use Neighborhoods\Kojo\Process\Signal\InformationInterface; use Neighborhoods\Kojo\ProcessInterface; use Neighborhoods\Pylon\Data\Property\Defensive; @@ -15,7 +16,7 @@ abstract class PoolAbstract implements PoolInterface use Process\AwareTrait; use Process\Signal\AwareTrait; - abstract public function childExitSignal(): PoolInterface; + abstract protected function _childExitSignal(InformationInterface $information): PoolInterface; public function hasAlarm(): bool { @@ -55,13 +56,12 @@ public function isFull(): bool protected function _initialize(): PoolInterface { - $this->_getProcessSignal()->addSignalHandler(SIGCHLD, [$this, 'childExitSignal']); $this->_getProcessPoolStrategy()->initializePool(); return $this; } - public function alarmSignal(): PoolInterface + protected function _alarmSignal(InformationInterface $information): PoolInterface { $this->_getProcessPoolStrategy()->receivedAlarm(); diff --git a/src/Process/PoolInterface.php b/src/Process/PoolInterface.php index 490aaf4a..7baca078 100644 --- a/src/Process/PoolInterface.php +++ b/src/Process/PoolInterface.php @@ -36,10 +36,4 @@ public function getCountOfChildProcesses(): int; public function setProcess(ProcessInterface $process); public function getProcess(): ProcessInterface; - - public function waitForSignal(): PoolInterface; - - public function childExitSignal(): PoolInterface; - - public function alarmSignal(): PoolInterface; } \ No newline at end of file diff --git a/src/Process/Root.php b/src/Process/Root.php index 26c1b51d..0bf7069f 100644 --- a/src/Process/Root.php +++ b/src/Process/Root.php @@ -17,7 +17,7 @@ public function __construct() protected function _run(): Forked { while (true) { - $this->_getProcessPool()->waitForSignal(); + $this->_getProcessSignal()->waitForSignal(); } return $this; diff --git a/src/Process/Signal.php b/src/Process/Signal.php index 9b706216..6ade4d9c 100644 --- a/src/Process/Signal.php +++ b/src/Process/Signal.php @@ -4,13 +4,15 @@ namespace Neighborhoods\Kojo\Process; use Neighborhoods\Kojo\Process\Signal\HandlerInterface; +use Neighborhoods\Kojo\Process\Signal\InformationInterface; use Neighborhoods\Pylon\Data\Property\Defensive; use Neighborhoods\Kojo\Process; class Signal implements SignalInterface { use Defensive\AwareTrait; - use Process\Signal\Information\AwareTrait; + use Process\Signal\Information\Factory\AwareTrait; + use Process\Pool\Logger\AwareTrait; protected $_waitCount = 0; protected $_signalHandlers = []; protected $_bufferedSignals = []; @@ -18,6 +20,7 @@ class Signal implements SignalInterface public function addSignalHandler(int $signalNumber, HandlerInterface $signalHandler): SignalInterface { $this->incrementWaitCount(); + pcntl_async_signals(true); $this->_signalHandlers[$signalNumber] = $signalHandler; pcntl_signal($signalNumber, [$this, 'handleSignal']); $this->decrementWaitCount(); @@ -34,10 +37,10 @@ public function incrementWaitCount(): SignalInterface public function decrementWaitCount(): SignalInterface { - while ($this->_waitCount >= 1) { + if ($this->_waitCount === 1) { $this->_processBufferedSignals(); - --$this->_waitCount; } + --$this->_waitCount; return $this; } @@ -45,8 +48,8 @@ public function decrementWaitCount(): SignalInterface protected function _processBufferedSignals(): SignalInterface { foreach ($this->_bufferedSignals as $position => $information) { - call_user_func([$this->_getSignalHandler($information->getSignalNumber()), 'handleSignal'], $information); unset($this->_bufferedSignals[$position]); + call_user_func([$this->_getSignalHandler($information->getSignalNumber()), 'handleSignal'], $information); } return $this; @@ -68,19 +71,27 @@ protected function _getSignalHandler(int $signalNumber): HandlerInterface public function handleSignal(int $signalNumber, $signalInformation): void { if ($signalNumber === SIGCHLD) { - $childProcessId = pcntl_wait($status, WNOHANG); - if ($childProcessId == -1) { - $error = var_export(pcntl_strerror(pcntl_get_last_error()), true); - }else { - $this->_bufferedSignals[] = $this->_getProcessSignalInformationClone()->hydrate($signalInformation); + while ($childProcessId = pcntl_wait($status, WNOHANG)) { + if ($childProcessId == -1) { + $errorMessage = var_export(pcntl_strerror(pcntl_get_last_error()), true); + $this->_getLogger()->notice("Encountered a process control wait error with message[$errorMessage]."); + break; + }else { + $this->_getLogger()->info("Handling signal from child process ID[$childProcessId]."); + $childInformation[InformationInterface::SIGNAL_NUMBER] = SIGCHLD; + $childInformation[InformationInterface::PROCESS_ID] = $childProcessId; + $childInformation[InformationInterface::EXIT_VALUE] = $status; + $information = $this->_getProcessSignalInformationFactory()->create()->hydrate($childInformation); + $this->_bufferedSignals[] = $information; + } } }else { - $this->_bufferedSignals[] = $this->_getProcessSignalInformationClone()->hydrate($signalInformation); + $information = $this->_getProcessSignalInformationFactory()->create()->hydrate($signalInformation); + $this->_getLogger()->info("Handling signal number[{$information->getSignalNumber()}]."); + $this->_bufferedSignals[] = $information; } if ($this->_waitCount === 0) { $this->_processBufferedSignals(); - }elseif ($this->_waitCount < 2) { - ++$this->_waitCount; } return; diff --git a/src/Process/Signal/Information.php b/src/Process/Signal/Information.php index 0d50a253..4c581ea6 100644 --- a/src/Process/Signal/Information.php +++ b/src/Process/Signal/Information.php @@ -3,11 +3,8 @@ namespace Neighborhoods\Kojo\Process\Signal; -use Neighborhoods\Pylon\Data\Property\Defensive; - class Information implements InformationInterface { - use Defensive\AwareTrait; protected $_information; public function hydrate(array $information): InformationInterface diff --git a/src/Process/Signal/Information/Collection.php b/src/Process/Signal/Information/Collection.php deleted file mode 100644 index 30d11f6a..00000000 --- a/src/Process/Signal/Information/Collection.php +++ /dev/null @@ -1,61 +0,0 @@ -_informationCollection[] = $information; - - return $this; - } - - public function unsetInformation(int $position): CollectionInterface - { - if (!isset($this->_informationCollection[$position])) { - throw new \LogicException("Information at position[$position] is not set."); - } - unset($this->_informationCollection[$position]); - - return $this; - } - - public function current(): InformationInterface - { - return $this->_informationCollection[$this->_position]; - } - - public function next() - { - return ++$this->_position; - } - - public function key(): int - { - return $this->_position; - } - - public function valid(): bool - { - return isset($this->_informationCollection[$this->_position]); - } - - public function rewind() - { - $position = reset($this->_informationCollection); - if ($position !== false) { - $this->_position = key($this->_informationCollection); - }else { - $this->_position = 0; - } - - return; - } -} \ No newline at end of file diff --git a/src/Process/Signal/Information/Collection/AwareTrait.php b/src/Process/Signal/Information/Collection/AwareTrait.php deleted file mode 100644 index ef78aea5..00000000 --- a/src/Process/Signal/Information/Collection/AwareTrait.php +++ /dev/null @@ -1,38 +0,0 @@ -_create(CollectionInterface::class, $processSignalInformationCollection); - - return $this; - } - - protected function _getProcessSignalInformationCollection(): CollectionInterface - { - return $this->_read(CollectionInterface::class); - } - - protected function _getProcessSignalInformationCollectionClone(): CollectionInterface - { - return clone $this->_getProcessSignalInformationCollection(); - } - - protected function _hasProcessSignalInformationCollection(): bool - { - return $this->_exists(CollectionInterface::class); - } - - protected function _unsetProcessSignalInformationCollection(): self - { - $this->_delete(CollectionInterface::class); - - return $this; - } -} \ No newline at end of file diff --git a/src/Process/Signal/Information/CollectionInterface.php b/src/Process/Signal/Information/CollectionInterface.php deleted file mode 100644 index 41f82c28..00000000 --- a/src/Process/Signal/Information/CollectionInterface.php +++ /dev/null @@ -1,23 +0,0 @@ -_getProcessSignalInformationClone(); + + return $signalInformation; + } +} \ No newline at end of file diff --git a/src/Process/Signal/Information/Factory/AwareTrait.php b/src/Process/Signal/Information/Factory/AwareTrait.php new file mode 100644 index 00000000..952595cd --- /dev/null +++ b/src/Process/Signal/Information/Factory/AwareTrait.php @@ -0,0 +1,38 @@ +_create(FactoryInterface::class, $processSignalInformationFactory); + + return $this; + } + + protected function _getProcessSignalInformationFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _getProcessSignalInformationFactoryClone(): FactoryInterface + { + return clone $this->_getProcessSignalInformationFactory(); + } + + protected function _hasProcessSignalInformationFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _unsetProcessSignalInformationFactory(): self + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Process/Signal/Information/FactoryInterface.php b/src/Process/Signal/Information/FactoryInterface.php new file mode 100644 index 00000000..7b273874 --- /dev/null +++ b/src/Process/Signal/Information/FactoryInterface.php @@ -0,0 +1,11 @@ +_getProcessSignal()->incrementWaitCount(); $this->_setParentProcessId(posix_getppid()); $this->_setProcessId(posix_getpid()); + $this->_getLogger()->setProcess($this); + if ($this->_hasProcessPool()) { + $this->_getProcessPool()->emptyChildProcesses(); + $this->_unsetProcessPool(); + } + $this->setProcessPool($this->_getProcessPoolFactory()->create()); + $this->_getProcessPool()->setProcess($this); $this->_registerSignalHandlers(); - $this->_setProcessTitle(); $this->_getProcessRegistry()->pushProcess($this); + $this->_setProcessTitle(); + $this->_getProcessSignal()->decrementWaitCount(); return $this; } - abstract public function processPoolStarted(): ProcessInterface; + protected function _registerSignalHandlers(): ProcessInterface + { + $this->_getProcessSignal()->addSignalHandler(SIGCHLD, $this->_getProcessPool()); + $this->_getProcessSignal()->addSignalHandler(SIGALRM, $this->_getProcessPool()); + $this->_getProcessSignal()->addSignalHandler(SIGTERM, $this); + $this->_getProcessSignal()->addSignalHandler(SIGINT, $this); + $this->_getProcessSignal()->addSignalHandler(SIGHUP, $this); + $this->_getProcessSignal()->addSignalHandler(SIGQUIT, $this); + $this->_getProcessSignal()->addSignalHandler(SIGABRT, $this); + + return $this; + } protected function _setProcessTitle(): ProcessInterface { @@ -52,27 +75,10 @@ protected function _getTitlePrefix(): string return $this->_read(self::PROP_TITLE_PREFIX); } - protected function _registerSignalHandlers(): ProcessInterface - { - $this->_getProcessSignal()->addBlockedSignalNumber(SIGTERM); - $this->_getProcessSignal()->addBlockedSignalNumber(SIGINT); - $this->_getProcessSignal()->addBlockedSignalNumber(SIGHUP); - $this->_getProcessSignal()->addBlockedSignalNumber(SIGQUIT); - $this->_getProcessSignal()->addBlockedSignalNumber(SIGABRT); - $this->_getProcessSignal()->block(); - $this->_getProcessSignal()->addSignalHandler(SIGTERM, [$this, 'receivedSignal']); - $this->_getProcessSignal()->addSignalHandler(SIGINT, [$this, 'receivedSignal']); - $this->_getProcessSignal()->addSignalHandler(SIGHUP, [$this, 'receivedSignal']); - $this->_getProcessSignal()->addSignalHandler(SIGQUIT, [$this, 'receivedSignal']); - $this->_getProcessSignal()->addSignalHandler(SIGABRT, [$this, 'receivedSignal']); - - return $this; - } - - public function receivedSignal(int $signalNumber, $signalInformation) + public function handleSignal(InformationInterface $information): HandlerInterface { $this->_getProcessSignal()->block(); - $this->exit($signalNumber); + $this->exit(0); } public function exit(int $exitCode) diff --git a/src/ProcessInterface.php b/src/ProcessInterface.php index a187bd5d..ff198b45 100644 --- a/src/ProcessInterface.php +++ b/src/ProcessInterface.php @@ -5,8 +5,9 @@ use Neighborhoods\Kojo\Process\Pool\LoggerInterface; use Neighborhoods\Kojo\Process\PoolInterface; +use Neighborhoods\Kojo\Process\Signal\HandlerInterface; -interface ProcessInterface +interface ProcessInterface extends HandlerInterface { const PROP_THROTTLE = 'throttle'; const PROP_EXIT_CODE = 'exit_code'; @@ -41,8 +42,6 @@ public function setTypeCode(string $typeCode): ProcessInterface; public function setProcessPool(PoolInterface $pool); - public function receivedSignal(int $signalNumber, $signalInformation); - public function setParentProcessPath(string $parentProcessPath): ProcessInterface; public function getPath(): string; @@ -63,7 +62,5 @@ public function getParentProcessTerminationSignalNumber(); public function setParentProcessTerminationSignalNumber(int $parentProcessTerminationSignalNumber); - public function processPoolStarted(): ProcessInterface; - public function exit(int $exitCode); } \ No newline at end of file diff --git a/tests/config/root.yml b/tests/config/root.yml index 7f7e3bba..e72821f7 100644 --- a/tests/config/root.yml +++ b/tests/config/root.yml @@ -1,5 +1,5 @@ imports: - - { resource: ../../../config/root.yml } + - { resource: ../../config/root.yml } - { resource: Process/Strategy/Mock.yml } services: neighborhoods.kojo.db.connection.container-schema: From 500aacf655cbf9fdd044b109109854d5c19eef61 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 9 Apr 2018 09:19:28 -0500 Subject: [PATCH 17/44] - logging language mre better --- src/Maintainer.php | 2 +- src/Process/Pool.php | 14 +++++++------- src/Process/Pool/Server.php | 2 +- src/Process/PoolAbstract.php | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Maintainer.php b/src/Maintainer.php index 58959684..8cf61461 100644 --- a/src/Maintainer.php +++ b/src/Maintainer.php @@ -110,7 +110,7 @@ protected function _updatePendingJobs(): Maintainer $updatePanic = $this->_getServiceUpdatePanicFactory()->create(); $updatePanic->setJob($job); $updatePanic->save(); - $this->_getLogger()->alert('Panicking Job[' . $job->getId() . '].'); + $this->_getLogger()->alert('Panicking job[' . $job->getId() . '].'); } } diff --git a/src/Process/Pool.php b/src/Process/Pool.php index 2e0a75f2..12d91e81 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -31,7 +31,7 @@ public function handleSignal(InformationInterface $signalInformation): HandlerIn $this->_alarmSignal($signalInformation); break; default: - throw new \UnexpectedValueException("Unexpected signal number [$signalNumber]."); + throw new \UnexpectedValueException("Unexpected signal number[$signalNumber]."); } return $this; @@ -59,14 +59,14 @@ public function freeChildProcess(int $childProcessId): PoolInterface if (isset($this->_childProcesses[$childProcessId])) { if ($this->_childProcesses[$childProcessId] instanceof ProcessInterface) { $typeCode = $this->_childProcesses[$childProcessId]->getTypeCode(); - $this->_getLogger()->info("Freeing child process related to Process[$childProcessId][$typeCode]."); + $this->_getLogger()->info("Freeing child process related to process[$childProcessId][$typeCode]."); unset($this->_childProcesses[$childProcessId]); }else { - $message = "Process associated to Process[$childProcessId] is not an expected type."; + $message = "Process associated to process[$childProcessId] is not an expected type."; throw new \UnexpectedValueException($message); } }else { - throw new \LogicException("Process associated to Process[$childProcessId] is not in the process pool."); + throw new \LogicException("Process associated to process[$childProcessId] is not in the process pool."); } return $this; @@ -85,7 +85,7 @@ public function addChildProcess(ProcessInterface $childProcess): PoolInterface }else { $childProcess->start(); $this->_childProcesses[$childProcess->getProcessId()] = $childProcess; - $message = "Forked Process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; + $message = "Forked process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; $this->_getLogger()->info($message); } $this->_getProcessSignal()->decrementWaitCount(); @@ -96,7 +96,7 @@ public function addChildProcess(ProcessInterface $childProcess): PoolInterface public function getChildProcess(int $childProcessId): ProcessInterface { if (!isset($this->_childProcesses[$childProcessId])) { - throw new \LogicException("Process with process ID [$childProcessId] not set."); + throw new \LogicException("Process with process ID[$childProcessId] not set."); } return $this->_childProcesses[$childProcessId]; @@ -112,7 +112,7 @@ public function terminateChildProcesses(): PoolInterface $terminationSignalNumber = $process->getTerminationSignalNumber(); $processTypeCode = $process->getTypeCode(); posix_kill($processId, $terminationSignalNumber); - $message = "Sent kill($terminationSignalNumber) to Process[$processId][$processTypeCode]."; + $message = "Sent kill($terminationSignalNumber) to process[$processId][$processTypeCode]."; $this->_getLogger()->info($message); unset($this->_childProcesses[$processId]); } diff --git a/src/Process/Pool/Server.php b/src/Process/Pool/Server.php index fde9abc6..f5be99e2 100644 --- a/src/Process/Pool/Server.php +++ b/src/Process/Pool/Server.php @@ -29,7 +29,7 @@ public function start(): ProcessInterface $this->_getProcessSignal()->waitForSignal(); } }else { - $this->_getLogger()->info('Cannot obtain process pool server mutex. Quitting.'); + $this->_getLogger()->info('Cannot obtain the process pool server mutex. Quitting.'); } return $this; diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index da8f7412..81e3441c 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -31,7 +31,7 @@ public function hasAlarm(): bool public function setAlarm(int $seconds): PoolInterface { - $this->_getLogger()->info('Setting alarm for ' . $seconds . ' seconds.'); + $this->_getLogger()->info('Setting alarm for [' . $seconds . '] seconds.'); pcntl_alarm($seconds); return $this; From 4f89058c11acf0bc5b035da65d975bb1c0bd41ec Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 9 Apr 2018 09:25:17 -0500 Subject: [PATCH 18/44] - linted - spelling --- src/Process/Forked.php | 1 - src/Process/Pool/Logger.php | 1 - src/ProcessAbstract.php | 2 ++ src/Worker/Job/Service.php | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Process/Forked.php b/src/Process/Forked.php index fda1d53d..96785e7e 100644 --- a/src/Process/Forked.php +++ b/src/Process/Forked.php @@ -5,7 +5,6 @@ use Neighborhoods\Kojo\ProcessAbstract; use Neighborhoods\Kojo\ProcessInterface; -use Neighborhoods\Kojo\Process; abstract class Forked extends ProcessAbstract implements ProcessInterface { diff --git a/src/Process/Pool/Logger.php b/src/Process/Pool/Logger.php index 022c0fe8..123ef266 100644 --- a/src/Process/Pool/Logger.php +++ b/src/Process/Pool/Logger.php @@ -7,7 +7,6 @@ use Neighborhoods\Pylon\Time; use Neighborhoods\Kojo\ProcessInterface; use Neighborhoods\Pylon\Data\Property\Defensive; -use Psr\Log\LogLevel; class Logger extends Log\AbstractLogger implements LoggerInterface { diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index cd9d5341..e926c6be 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -79,6 +79,8 @@ public function handleSignal(InformationInterface $information): HandlerInterfac { $this->_getProcessSignal()->block(); $this->exit(0); + + return $this; } public function exit(int $exitCode) diff --git a/src/Worker/Job/Service.php b/src/Worker/Job/Service.php index e1420f5e..def4e2ed 100644 --- a/src/Worker/Job/Service.php +++ b/src/Worker/Job/Service.php @@ -24,7 +24,7 @@ class Service implements ServiceInterface const REQUEST_HOLD = 'hold'; const REQUEST_COMPLETE_SUCCESS = 'complete_success'; const REQUEST_COMPLETE_FAILED = 'complete_failed'; - const PROP_REQUEST_APPPLIED = 'request_applied'; + const PROP_REQUEST_APPLIED = 'request_applied'; public function requestRetry(\DateTime $retryDateTime): ServiceInterface { @@ -68,7 +68,7 @@ public function requestCompleteFailed(): ServiceInterface public function applyRequest(): ServiceInterface { - if (!$this->_exists(self::PROP_REQUEST_APPPLIED)) { + if (!$this->_exists(self::PROP_REQUEST_APPLIED)) { switch ($this->_read(self::PROP_REQUEST)) { case self::REQUEST_RETRY: $updateRetry = $this->_getServiceUpdateRetryFactory()->create(); @@ -94,7 +94,7 @@ public function applyRequest(): ServiceInterface default: throw new \UnexpectedValueException('Unexpected value "' . $this->_read(self::PROP_REQUEST) . '"'); } - $this->_create(self::PROP_REQUEST_APPPLIED, true); + $this->_create(self::PROP_REQUEST_APPLIED, true); } return $this; @@ -102,7 +102,7 @@ public function applyRequest(): ServiceInterface public function isRequestApplied(): bool { - return $this->_exists(self::PROP_REQUEST_APPPLIED); + return $this->_exists(self::PROP_REQUEST_APPLIED); } public function getNewJobServiceCreate(): CreateInterface From 589da8daf9c475e2568630acb16a65582302c9d5 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Thu, 12 Apr 2018 16:30:07 -0500 Subject: [PATCH 19/44] - move away from YAML import sigils in favor of locating from a root dir -- moved DI files to be neighbors of their classes --- easier to reason, faster to iterate - created a true db connection container factory and repo. -- refactored appropriately - implemented parent DI - started adding in environment parameters and associated defaults - added intelligent process shutdown handling -- parent process shutdown methods are disabled -- this can gracefully intercept OOM scenarios --- README.md | 10 +- bin/kojo | 16 ++- config/Data/Job.yml | 8 -- config/Db/Connection/Container.yml | 13 -- config/root.yml | 130 ------------------ example/Worker/Bootstrap.php | 3 +- example/Worker/Bootstrap.yml | 9 ++ example/config/root.yml | 16 --- {config => src}/CacheItemPool/Factory.yml | 0 {config => src}/CacheItemPool/Repository.yml | 0 .../Console/Command/Db/Setup/Install.yml | 0 .../Console/Command/Db/TearDown/Uninstall.yml | 0 .../Command/Process/Pool/Server/Start.php | 24 ++-- .../Command/Process/Pool/Server/Start.yml | 0 src/Data/Job.php | 3 - src/Data/Job.yml | 8 ++ .../Data/Job/Collection/CrashDetection.yml | 7 +- src/Data/Job/Collection/Delete.php | 4 +- .../Data/Job/Collection/Delete.yml | 8 +- .../Data/Job/Collection/Iterator.yml | 0 .../Job/Collection/Schedule/LimitCheck.yml | 7 +- src/Data/Job/Collection/ScheduleLimit.php | 6 +- .../Data/Job/Collection/ScheduleLimit.yml | 7 +- src/Data/Job/Collection/Scheduler.php | 3 +- .../Data/Job/Collection/Scheduler.yml | 7 +- src/Data/Job/Collection/Selector.php | 4 +- .../Data/Job/Collection/Selector.yml | 7 +- src/Data/Job/CollectionAbstract.php | 13 -- src/Data/Job/CollectionAbstract.yml | 12 ++ {config => src}/Data/Job/Type.yml | 7 +- .../Data/Job/Type/Collection/Iterator.yml | 0 .../Data/Job/Type/Collection/Scheduler.yml | 6 +- src/Db/Connection/Container.php | 18 +-- src/Db/Connection/Container.yml | 8 ++ src/Db/Connection/Container/AwareTrait.php | 32 +++-- src/Db/Connection/Container/Factory.php | 20 +++ src/Db/Connection/Container/Factory.yml | 10 ++ .../Container/Factory/AwareTrait.php | 38 +++++ .../Connection/Container/FactoryInterface.php | 13 ++ src/Db/Connection/Container/Repository.php | 43 ++++++ src/Db/Connection/Container/Repository.yml | 13 ++ .../Container/Repository/AwareTrait.php | 38 +++++ .../Container/RepositoryInterface.php | 15 ++ src/Db/Connection/ContainerInterface.php | 14 +- src/Db/Model.php | 27 ++-- src/Db/Model.yml | 11 ++ src/Db/Model/CollectionAbstract.php | 19 ++- src/Db/Model/CollectionInterface.php | 4 +- src/Db/ModelInterface.php | 4 +- src/Db/Schema/VersionAbstract.php | 11 +- {config => src}/Db/Setup.yml | 0 .../Db/Setup/Schema/Version_0_0_0.yml | 2 +- .../Db/Setup/Schema/Version_1_0_0.yml | 2 +- .../Db/Setup/Schema/Version_2_0_0.yml | 2 +- .../Db/Setup/Schema/Version_3_0_0.yml | 2 +- .../Db/Setup/Schema/Version_4_0_0.yml | 2 +- .../Db/Setup/Schema/Version_5_0_0.yml | 2 +- .../Db/Setup/Schema/Version_6_0_0.yml | 2 +- {config => src}/Db/TearDown.yml | 0 .../Db/TearDown/Schema/Version_0_0_0.yml | 2 +- .../Db/TearDown/Schema/Version_1_0_0.yml | 2 +- .../Db/TearDown/Schema/Version_2_0_0.yml | 2 +- .../Db/TearDown/Schema/Version_3_0_0.yml | 2 +- .../Db/TearDown/Schema/Version_4_0_0.yml | 2 +- .../Db/TearDown/Schema/Version_5_0_0.yml | 2 +- .../Db/TearDown/Schema/Version_6_0_0.yml | 2 +- .../dependencies.yml => src/Dependencies.yml | 0 src/Environment/Parameters.yml | 7 + src/Foreman.php | 63 +++++---- {config => src}/Foreman.yml | 0 {config => src}/Maintainer.yml | 0 {config => src}/Maintainer/Delete.yml | 0 {config => src}/Message/Broker/Redis.yml | 0 .../Message/Broker/Type/Collection.yml | 0 {config => src}/Process.yml | 0 {config => src}/Process/Collection.yml | 0 .../Process/Collection/Iterator.yml | 0 {config => src}/Process/Job.yml | 0 {config => src}/Process/Job/Required.yml | 0 {config => src}/Process/Listener/Command.yml | 0 .../Process/Listener/Mutex/Redis.yml | 0 {config => src}/Process/Pool.yml | 0 {config => src}/Process/Pool/Factory.yml | 0 {config => src}/Process/Pool/Logger.yml | 0 {config => src}/Process/Pool/Server.yml | 0 {config => src}/Process/Pool/Strategy.yml | 0 src/Process/PoolAbstract.php | 6 +- {config => src}/Process/Registry.yml | 0 {config => src}/Process/Root.yml | 0 src/Process/Signal.php | 6 +- {config => src}/Process/Signal.yml | 0 .../Process/Signal/Information.yml | 0 .../Process/Signal/Information/Factory.yml | 0 .../Process/Strategy/ProcessControl.yml | 0 src/ProcessAbstract.php | 32 ++++- src/ProcessInterface.php | 33 +++-- {config => src}/Redis.yml | 0 {config => src}/Redis/Factory.yml | 0 {config => src}/Redis/Repository.yml | 0 {config => src}/Scheduler.yml | 0 {config => src}/Scheduler/Cache.yml | 0 {config => src}/Scheduler/Time.yml | 0 {config => src}/Selector.yml | 0 {config => src}/Semaphore.yml | 0 src/Semaphore/AwareTrait.php | 14 +- {config => src}/Semaphore/Mutex/Flock.yml | 0 {config => src}/Semaphore/Mutex/Redis.yml | 0 {config => src}/Semaphore/Resource.yml | 0 src/Semaphore/Resource/AwareTrait.php | 13 ++ .../Semaphore/Resource/Factory.yml | 0 .../Semaphore/Resource/Owner/Job.yml | 0 src/Service/Container.php | 63 ++++++++- {config => src}/Service/Create.yml | 0 {config => src}/Service/Create/Factory.yml | 0 src/Service/Defaults.yml | 5 + .../Service/Update/Complete/Failed.yml | 0 .../Update/Complete/Failed/Factory.yml | 0 .../Complete/FailedScheduleLimitCheck.yml | 0 .../FailedScheduleLimitCheck/Factory.yml | 0 .../Service/Update/Complete/Success.yml | 0 .../Update/Complete/Success/Factory.yml | 0 {config => src}/Service/Update/Crash.yml | 0 .../Service/Update/Crash/Factory.yml | 0 {config => src}/Service/Update/Hold.yml | 0 .../Service/Update/Hold/Factory.yml | 0 {config => src}/Service/Update/Panic.yml | 0 .../Service/Update/Panic/Factory.yml | 0 {config => src}/Service/Update/Retry.yml | 0 .../Service/Update/Retry/Factory.yml | 0 {config => src}/Service/Update/Wait.yml | 0 .../Service/Update/Wait/Factory.yml | 0 {config => src}/Service/Update/Work.yml | 0 .../Service/Update/Work/Factory.yml | 0 {config => src}/State/Service.yml | 0 {config => src}/Type/Repository.yml | 6 +- {config => src}/Type/Service/Create.yml | 0 {config => src}/Worker/Bootstrap.yml | 0 src/Worker/BootstrapAbstract.php | 7 +- src/Worker/BootstrapAbstract.yml | 12 ++ src/Worker/BootstrapInterface.php | 6 - {config => src}/Worker/Job/Service.yml | 0 {config => src}/Worker/Locator.yml | 0 142 files changed, 615 insertions(+), 362 deletions(-) delete mode 100644 config/Data/Job.yml delete mode 100644 config/Db/Connection/Container.yml delete mode 100644 config/root.yml create mode 100644 example/Worker/Bootstrap.yml delete mode 100644 example/config/root.yml rename {config => src}/CacheItemPool/Factory.yml (100%) rename {config => src}/CacheItemPool/Repository.yml (100%) rename {config => src}/Console/Command/Db/Setup/Install.yml (100%) rename {config => src}/Console/Command/Db/TearDown/Uninstall.yml (100%) rename {config => src}/Console/Command/Process/Pool/Server/Start.yml (100%) create mode 100644 src/Data/Job.yml rename {config => src}/Data/Job/Collection/CrashDetection.yml (75%) rename {config => src}/Data/Job/Collection/Delete.yml (59%) rename {config => src}/Data/Job/Collection/Iterator.yml (100%) rename {config => src}/Data/Job/Collection/Schedule/LimitCheck.yml (75%) rename {config => src}/Data/Job/Collection/ScheduleLimit.yml (61%) rename {config => src}/Data/Job/Collection/Scheduler.yml (61%) rename {config => src}/Data/Job/Collection/Selector.yml (61%) create mode 100644 src/Data/Job/CollectionAbstract.yml rename {config => src}/Data/Job/Type.yml (50%) rename {config => src}/Data/Job/Type/Collection/Iterator.yml (100%) rename {config => src}/Data/Job/Type/Collection/Scheduler.yml (82%) create mode 100644 src/Db/Connection/Container.yml create mode 100644 src/Db/Connection/Container/Factory.php create mode 100644 src/Db/Connection/Container/Factory.yml create mode 100644 src/Db/Connection/Container/Factory/AwareTrait.php create mode 100644 src/Db/Connection/Container/FactoryInterface.php create mode 100644 src/Db/Connection/Container/Repository.php create mode 100644 src/Db/Connection/Container/Repository.yml create mode 100644 src/Db/Connection/Container/Repository/AwareTrait.php create mode 100644 src/Db/Connection/Container/RepositoryInterface.php create mode 100644 src/Db/Model.yml rename {config => src}/Db/Setup.yml (100%) rename {config => src}/Db/Setup/Schema/Version_0_0_0.yml (72%) rename {config => src}/Db/Setup/Schema/Version_1_0_0.yml (72%) rename {config => src}/Db/Setup/Schema/Version_2_0_0.yml (72%) rename {config => src}/Db/Setup/Schema/Version_3_0_0.yml (72%) rename {config => src}/Db/Setup/Schema/Version_4_0_0.yml (71%) rename {config => src}/Db/Setup/Schema/Version_5_0_0.yml (72%) rename {config => src}/Db/Setup/Schema/Version_6_0_0.yml (72%) rename {config => src}/Db/TearDown.yml (100%) rename {config => src}/Db/TearDown/Schema/Version_0_0_0.yml (73%) rename {config => src}/Db/TearDown/Schema/Version_1_0_0.yml (73%) rename {config => src}/Db/TearDown/Schema/Version_2_0_0.yml (73%) rename {config => src}/Db/TearDown/Schema/Version_3_0_0.yml (73%) rename {config => src}/Db/TearDown/Schema/Version_4_0_0.yml (73%) rename {config => src}/Db/TearDown/Schema/Version_5_0_0.yml (73%) rename {config => src}/Db/TearDown/Schema/Version_6_0_0.yml (73%) rename config/dependencies.yml => src/Dependencies.yml (100%) create mode 100644 src/Environment/Parameters.yml rename {config => src}/Foreman.yml (100%) rename {config => src}/Maintainer.yml (100%) rename {config => src}/Maintainer/Delete.yml (100%) rename {config => src}/Message/Broker/Redis.yml (100%) rename {config => src}/Message/Broker/Type/Collection.yml (100%) rename {config => src}/Process.yml (100%) rename {config => src}/Process/Collection.yml (100%) rename {config => src}/Process/Collection/Iterator.yml (100%) rename {config => src}/Process/Job.yml (100%) rename {config => src}/Process/Job/Required.yml (100%) rename {config => src}/Process/Listener/Command.yml (100%) rename {config => src}/Process/Listener/Mutex/Redis.yml (100%) rename {config => src}/Process/Pool.yml (100%) rename {config => src}/Process/Pool/Factory.yml (100%) rename {config => src}/Process/Pool/Logger.yml (100%) rename {config => src}/Process/Pool/Server.yml (100%) rename {config => src}/Process/Pool/Strategy.yml (100%) rename {config => src}/Process/Registry.yml (100%) rename {config => src}/Process/Root.yml (100%) rename {config => src}/Process/Signal.yml (100%) rename {config => src}/Process/Signal/Information.yml (100%) rename {config => src}/Process/Signal/Information/Factory.yml (100%) rename {config => src}/Process/Strategy/ProcessControl.yml (100%) rename {config => src}/Redis.yml (100%) rename {config => src}/Redis/Factory.yml (100%) rename {config => src}/Redis/Repository.yml (100%) rename {config => src}/Scheduler.yml (100%) rename {config => src}/Scheduler/Cache.yml (100%) rename {config => src}/Scheduler/Time.yml (100%) rename {config => src}/Selector.yml (100%) rename {config => src}/Semaphore.yml (100%) rename {config => src}/Semaphore/Mutex/Flock.yml (100%) rename {config => src}/Semaphore/Mutex/Redis.yml (100%) rename {config => src}/Semaphore/Resource.yml (100%) rename {config => src}/Semaphore/Resource/Factory.yml (100%) rename {config => src}/Semaphore/Resource/Owner/Job.yml (100%) rename {config => src}/Service/Create.yml (100%) rename {config => src}/Service/Create/Factory.yml (100%) create mode 100644 src/Service/Defaults.yml rename {config => src}/Service/Update/Complete/Failed.yml (100%) rename {config => src}/Service/Update/Complete/Failed/Factory.yml (100%) rename {config => src}/Service/Update/Complete/FailedScheduleLimitCheck.yml (100%) rename {config => src}/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml (100%) rename {config => src}/Service/Update/Complete/Success.yml (100%) rename {config => src}/Service/Update/Complete/Success/Factory.yml (100%) rename {config => src}/Service/Update/Crash.yml (100%) rename {config => src}/Service/Update/Crash/Factory.yml (100%) rename {config => src}/Service/Update/Hold.yml (100%) rename {config => src}/Service/Update/Hold/Factory.yml (100%) rename {config => src}/Service/Update/Panic.yml (100%) rename {config => src}/Service/Update/Panic/Factory.yml (100%) rename {config => src}/Service/Update/Retry.yml (100%) rename {config => src}/Service/Update/Retry/Factory.yml (100%) rename {config => src}/Service/Update/Wait.yml (100%) rename {config => src}/Service/Update/Wait/Factory.yml (100%) rename {config => src}/Service/Update/Work.yml (100%) rename {config => src}/Service/Update/Work/Factory.yml (100%) rename {config => src}/State/Service.yml (100%) rename {config => src}/Type/Repository.yml (51%) rename {config => src}/Type/Service/Create.yml (100%) rename {config => src}/Worker/Bootstrap.yml (100%) create mode 100644 src/Worker/BootstrapAbstract.yml rename {config => src}/Worker/Job/Service.yml (100%) rename {config => src}/Worker/Locator.yml (100%) diff --git a/README.md b/README.md index a7c527fa..ba5a7688 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,15 @@ # 工場 A distributed task manager. +### `Kōjō` is a collection of the following components: +* Distributed task management. +* Distributed, cooperative, process-aware semaphores and mutex's. +* Static cron scheduling. +* Multi-process model. +* Status system. +* Distributed IPC. + ### Example usage ```bash -$ bin/kojo process:pool:server:start $PWD/example/config/root.yml +$ bin/kojo process:pool:server:start $PWD/example ``` \ No newline at end of file diff --git a/bin/kojo b/bin/kojo index bc921856..d1f30888 100755 --- a/bin/kojo +++ b/bin/kojo @@ -27,15 +27,15 @@ try{ exit(1); } $serviceContainer = new Container(); -$ymlServiceFilePath = __DIR__ . '/../config/root.yml'; -$serviceContainer->addServicesYmlFilePath($ymlServiceFilePath); +$ymlServiceFilePath = __DIR__ . '/../src'; +$serviceContainer->addRootDirectoryPath($ymlServiceFilePath); if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { - $serviceContainer->addServicesYmlFilePath($argv[2]); + $serviceContainer->addRootDirectoryPath($argv[2]); }elseif (isset($argv[1]) && is_string($argv[1]) && $argv[1] === Start::OPT_RUN_SERVER) { foreach ($argv as $argument) { - if (strstr($argument, 'ysfp:') !== false) { - $ymlServicesFilePath = explode('ysfp:', $argument); - $serviceContainer->addServicesYmlFilePath($ymlServicesFilePath[1]); + if (strstr($argument, Start::OPT_YSDP) !== false) { + $ymlServicesFilePath = explode(Start::OPT_YSDP, $argument); + $serviceContainer->addRootDirectoryPath($ymlServicesFilePath[1]); } } $server = $serviceContainer->getContainerBuilder()->get('process.pool.server'); @@ -43,6 +43,8 @@ if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { $server->start(); exit(); } -$consoleApplication = $serviceContainer->getContainerBuilder()->get('neighborhoods.kojo.symfony.component.console.application'); +$containerBuilder = $serviceContainer->getContainerBuilder(); +$consoleApplication = $containerBuilder->get('neighborhoods.kojo.symfony.component.console.application'); $consoleApplication->run(); + return; \ No newline at end of file diff --git a/config/Data/Job.yml b/config/Data/Job.yml deleted file mode 100644 index bdc7e7aa..00000000 --- a/config/Data/Job.yml +++ /dev/null @@ -1,8 +0,0 @@ -services: - neighborhoods.kojo.data.job: - class: Neighborhoods\Kojo\Data\Job - shared: false - calls: - - [addDbConnectionContainer, ['@db.connection.container-job']] - data.job: - alias: neighborhoods.kojo.data.job \ No newline at end of file diff --git a/config/Db/Connection/Container.yml b/config/Db/Connection/Container.yml deleted file mode 100644 index 18341e7e..00000000 --- a/config/Db/Connection/Container.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - neighborhoods.kojo.db.connection.container-job: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_JOB]] - db.connection.container-job: - alias: neighborhoods.kojo.db.connection.container-job - neighborhoods.kojo.db.connection.container-schema: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_SCHEMA]] - db.connection.container-schema: - alias: neighborhoods.kojo.db.connection.container-schema \ No newline at end of file diff --git a/config/root.yml b/config/root.yml deleted file mode 100644 index d92a15c7..00000000 --- a/config/root.yml +++ /dev/null @@ -1,130 +0,0 @@ -services: - _defaults: - autowire: false - autoconfigure: false - public: false -imports: - # External dependencies. - - { resource: dependencies.yml } - - { resource: CacheItemPool/Factory.yml } - - { resource: CacheItemPool/Repository.yml } - - { resource: Redis/Factory.yml } - - { resource: Redis/Repository.yml } - - { resource: Redis.yml } - - # Manager. - - { resource: Foreman.yml } - - { resource: Scheduler.yml } - - { resource: Maintainer.yml } - - { resource: Selector.yml } - - # Manger delegate. - - { resource: Maintainer/Delete.yml } - - { resource: Scheduler/Time.yml } - - { resource: Scheduler/Cache.yml } - - # Data. - - { resource: Data/Job/Type.yml } - - { resource: Data/Job/Type/Collection/Iterator.yml} - - { resource: Data/Job/Type/Collection/Scheduler.yml } - - { resource: Data/Job.yml } - - { resource: Data/Job/Collection/Scheduler.yml } - - { resource: Data/Job/Collection/Selector.yml } - - { resource: Data/Job/Collection/Iterator.yml } - - { resource: Data/Job/Collection/ScheduleLimit.yml } - - { resource: Data/Job/Collection/CrashDetection.yml } - - { resource: Data/Job/Collection/Delete.yml } - - { resource: Data/Job/Collection/Schedule/LimitCheck.yml } - - # Repository. - - { resource: Type/Repository.yml } - - { resource: Type/Service/Create.yml } - - # Factory. - - { resource: Service/Update/Crash/Factory.yml } - - { resource: Service/Create/Factory.yml } - - { resource: Service/Update/Work/Factory.yml } - - { resource: Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml } - - { resource: Service/Update/Panic/Factory.yml } - - { resource: Service/Update/Wait/Factory.yml } - - { resource: Service/Update/Hold/Factory.yml } - - { resource: Service/Update/Retry/Factory.yml } - - { resource: Service/Update/Complete/Failed/Factory.yml } - - { resource: Service/Update/Complete/Success/Factory.yml } - - { resource: Semaphore/Resource/Factory.yml } - - { resource: Process/Pool/Factory.yml } - - { resource: Process/Signal/Information/Factory.yml } - - { resource: Redis/Factory.yml } - - # Services. - - { resource: State/Service.yml } - - { resource: Service/Create.yml } - - { resource: Service/Update/Crash.yml } - - { resource: Service/Update/Work.yml } - - { resource: Service/Update/Complete/FailedScheduleLimitCheck.yml } - - { resource: Service/Update/Panic.yml } - - { resource: Service/Update/Wait.yml } - - { resource: Service/Update/Hold.yml } - - { resource: Service/Update/Retry.yml } - - { resource: Service/Update/Complete/Failed.yml } - - { resource: Service/Update/Complete/Success.yml } - - # Semaphore. - - { resource: Semaphore/Resource.yml } - - { resource: Semaphore/Resource/Owner/Job.yml } - - { resource: Semaphore/Mutex/Flock.yml } - - { resource: Semaphore/Mutex/Redis.yml } - - { resource: Semaphore.yml } - - # Process. - - { resource: Process.yml } - - { resource: Process/Signal.yml } - - { resource: Process/Signal/Information.yml } - - { resource: Process/Root.yml } - - { resource: Process/Registry.yml } - - { resource: Process/Job.yml } - - { resource: Process/Job/Required.yml } - - { resource: Process/Listener/Command.yml } - - { resource: Process/Listener/Mutex/Redis.yml } - - { resource: Process/Pool/Server.yml } - - { resource: Process/Pool/Strategy.yml } - - { resource: Process/Pool.yml } - - { resource: Process/Collection.yml } - - { resource: Process/Collection/Iterator.yml } - - { resource: Process/Strategy/ProcessControl.yml } - - # Database. - - { resource: Db/Connection/Container.yml } - - { resource: Db/Setup.yml } - - { resource: Db/Setup/Schema/Version_0_0_0.yml } - - { resource: Db/Setup/Schema/Version_1_0_0.yml } - - { resource: Db/Setup/Schema/Version_2_0_0.yml } - - { resource: Db/Setup/Schema/Version_3_0_0.yml } - - { resource: Db/Setup/Schema/Version_4_0_0.yml } - - { resource: Db/Setup/Schema/Version_5_0_0.yml } - - { resource: Db/Setup/Schema/Version_6_0_0.yml } - - { resource: Db/TearDown.yml } - - { resource: Db/TearDown/Schema/Version_0_0_0.yml } - - { resource: Db/TearDown/Schema/Version_1_0_0.yml } - - { resource: Db/TearDown/Schema/Version_2_0_0.yml } - - { resource: Db/TearDown/Schema/Version_3_0_0.yml } - - { resource: Db/TearDown/Schema/Version_4_0_0.yml } - - { resource: Db/TearDown/Schema/Version_5_0_0.yml } - - { resource: Db/TearDown/Schema/Version_6_0_0.yml } - - # Message Broker. - - { resource: Message/Broker/Redis.yml } - - { resource: Message/Broker/Type/Collection.yml } - - # Worker. - - { resource: Worker/Locator.yml } - - { resource: Worker/Bootstrap.yml } - - { resource: Worker/Job/Service.yml } - - # Console. - - { resource: Console/Command/Process/Pool/Server/Start.yml } - - { resource: Console/Command/Db/Setup/Install.yml } - - { resource: Console/Command/Db/TearDown/Uninstall.yml } - - # Logging. - - { resource: Process/Pool/Logger.yml } \ No newline at end of file diff --git a/example/Worker/Bootstrap.php b/example/Worker/Bootstrap.php index 75a3c978..f79ef77c 100644 --- a/example/Worker/Bootstrap.php +++ b/example/Worker/Bootstrap.php @@ -12,8 +12,7 @@ class Bootstrap extends BootstrapAbstract public function instantiate(): BootstrapInterface { $pdo = new \PDO('mysql:dbname=kojo;host=mysql', 'root', 'nhdsroot'); - $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->setPdo($pdo); - $this->_getDbConnectionContainer(ContainerInterface::NAME_SCHEMA)->setPdo($pdo); + $this->_setJobPdo($pdo); return $this; } diff --git a/example/Worker/Bootstrap.yml b/example/Worker/Bootstrap.yml new file mode 100644 index 00000000..d98f3ccd --- /dev/null +++ b/example/Worker/Bootstrap.yml @@ -0,0 +1,9 @@ +services: + neighborhoods.kojo.example.worker.bootstrap: + class: Neighborhoods\Kojo\Example\Worker\Bootstrap + parent: worker.bootstrap_abstract + public: false + shared: false + worker.bootstrap: + alias: neighborhoods.kojo.example.worker.bootstrap + public: false \ No newline at end of file diff --git a/example/config/root.yml b/example/config/root.yml deleted file mode 100644 index 8a50047b..00000000 --- a/example/config/root.yml +++ /dev/null @@ -1,16 +0,0 @@ -services: - neighborhoods.kojo.db.connection.container-schema: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_SCHEMA]] - neighborhoods.kojo.db.connection.container-job: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_JOB]] - neighborhoods.kojo.example.worker.bootstrap: - class: Neighborhoods\Kojo\Example\Worker\Bootstrap - calls: - - [addDbConnectionContainer, ['@neighborhoods.kojo.db.connection.container-job']] - - [addDbConnectionContainer, ['@neighborhoods.kojo.db.connection.container-schema']] - worker.bootstrap: - alias: neighborhoods.kojo.example.worker.bootstrap \ No newline at end of file diff --git a/config/CacheItemPool/Factory.yml b/src/CacheItemPool/Factory.yml similarity index 100% rename from config/CacheItemPool/Factory.yml rename to src/CacheItemPool/Factory.yml diff --git a/config/CacheItemPool/Repository.yml b/src/CacheItemPool/Repository.yml similarity index 100% rename from config/CacheItemPool/Repository.yml rename to src/CacheItemPool/Repository.yml diff --git a/config/Console/Command/Db/Setup/Install.yml b/src/Console/Command/Db/Setup/Install.yml similarity index 100% rename from config/Console/Command/Db/Setup/Install.yml rename to src/Console/Command/Db/Setup/Install.yml diff --git a/config/Console/Command/Db/TearDown/Uninstall.yml b/src/Console/Command/Db/TearDown/Uninstall.yml similarity index 100% rename from config/Console/Command/Db/TearDown/Uninstall.yml rename to src/Console/Command/Db/TearDown/Uninstall.yml diff --git a/src/Console/Command/Process/Pool/Server/Start.php b/src/Console/Command/Process/Pool/Server/Start.php index e6094d01..f23e2205 100644 --- a/src/Console/Command/Process/Pool/Server/Start.php +++ b/src/Console/Command/Process/Pool/Server/Start.php @@ -8,8 +8,9 @@ class Start extends CommandAbstract { - const OPT_SERVICES_YML_FILE_PATH = 'services-yml-file-path'; - const OPT_RUN_SERVER = '--run-server'; + const OPT_SERVICES_YML_DIRECTORY_PATH = 'services-yml-directory-path'; + const OPT_YSDP = 'ysdp'; + const OPT_RUN_SERVER = '--run-server'; protected function _configure(): CommandAbstract { @@ -17,10 +18,10 @@ protected function _configure(): CommandAbstract $this->setDescription('Starts a new process pool server.'); $this->setHelp($this->_getHelp()); $this->addOption( - self::OPT_SERVICES_YML_FILE_PATH, - 'syfp', + self::OPT_SERVICES_YML_DIRECTORY_PATH, + self::OPT_YSDP, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, - 'Additional YML services file paths to load. These are loaded in the order provided.' + 'Additional YML services directory paths to load. These are loaded in the order provided.' ); return $this; @@ -29,9 +30,9 @@ protected function _configure(): CommandAbstract public function _execute(): CommandAbstract { $arguments = [self::OPT_RUN_SERVER]; - $arguments[] = 'ysfp:' . $this->_getInput()->getArgument(self::ARG_SERVICES_YML_FILE_PATH); - foreach ($this->_getInput()->getOption(self::OPT_SERVICES_YML_FILE_PATH) as $servicesYmlFilePath) { - $arguments[] = 'ysfp:' . $servicesYmlFilePath; + $arguments[] = self::OPT_YSDP . $this->_getInput()->getArgument(self::ARG_SERVICES_YML_FILE_PATH); + foreach ($this->_getInput()->getOption(self::OPT_SERVICES_YML_DIRECTORY_PATH) as $servicesYmlFilePath) { + $arguments[] = self::OPT_YSDP . $servicesYmlFilePath; } pcntl_exec(__DIR__ . '/../../../../../../bin/kojo', $arguments); $this->_getOutput()->writeln('An error occurred trying to start the process pool server.'); @@ -42,10 +43,9 @@ public function _execute(): CommandAbstract protected function _getHelp() { return <<<'EOD' -This command starts a new process pool server. -Currently only one server can be run at a time for a given machine. -If a server is already running this command will return immediately. -More than one server and named servers will be available in future releases. +This command starts a new collection of process pool servers. +The number of process pool servers that are started is defined in the dependency injection YML files. +The default number of servers started is one. EOD; } } \ No newline at end of file diff --git a/config/Console/Command/Process/Pool/Server/Start.yml b/src/Console/Command/Process/Pool/Server/Start.yml similarity index 100% rename from config/Console/Command/Process/Pool/Server/Start.yml rename to src/Console/Command/Process/Pool/Server/Start.yml diff --git a/src/Data/Job.php b/src/Data/Job.php index bb09cebd..46b047d7 100644 --- a/src/Data/Job.php +++ b/src/Data/Job.php @@ -5,12 +5,9 @@ use Neighborhoods\Kojo\Db\Model; use Neighborhoods\Pylon\TimeInterface; -use Neighborhoods\Pylon\Time; class Job extends Model implements JobInterface { - use Time\AwareTrait; - public function __construct() { $this->setTableName(JobInterface::TABLE_NAME); diff --git a/src/Data/Job.yml b/src/Data/Job.yml new file mode 100644 index 00000000..d8e85221 --- /dev/null +++ b/src/Data/Job.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.data.job: + class: Neighborhoods\Kojo\Data\Job + shared: false + parent: db.model + data.job: + alias: neighborhoods.kojo.data.job + public: false \ No newline at end of file diff --git a/config/Data/Job/Collection/CrashDetection.yml b/src/Data/Job/Collection/CrashDetection.yml similarity index 75% rename from config/Data/Job/Collection/CrashDetection.yml rename to src/Data/Job/Collection/CrashDetection.yml index 17b0db63..444fc84b 100644 --- a/config/Data/Job/Collection/CrashDetection.yml +++ b/src/Data/Job/Collection/CrashDetection.yml @@ -1,11 +1,12 @@ services: neighborhoods.kojo.data.job.collection.crashdetection: class: Neighborhoods\Kojo\Data\Job\Collection\CrashDetection + public: false shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job']] - [setIterator, ['@data.job.collection.iterator']] - - [addDbConnectionContainer, ['@db.connection.container-job']] - - [setLogger, ['@process.pool.logger']] data.job.collection.crashdetection: - alias: neighborhoods.kojo.data.job.collection.crashdetection \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.crashdetection + public: false \ No newline at end of file diff --git a/src/Data/Job/Collection/Delete.php b/src/Data/Job/Collection/Delete.php index 07d7840c..307246b6 100644 --- a/src/Data/Job/Collection/Delete.php +++ b/src/Data/Job/Collection/Delete.php @@ -31,7 +31,9 @@ protected function &_getRecords(): array $this->_create(self::PROP_RECORDS, []); } $select = $this->getSelect(); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($select); + $statement = $this->_getDbConnectionContainerRepository() + ->get(ContainerInterface::ID_JOB) + ->getStatement($select); /** @var \PDOStatement $pdoStatement */ $pdoStatement = $statement->execute()->getResource(); $pdoStatement->setFetchMode($this->_getFetchMode()); diff --git a/config/Data/Job/Collection/Delete.yml b/src/Data/Job/Collection/Delete.yml similarity index 59% rename from config/Data/Job/Collection/Delete.yml rename to src/Data/Job/Collection/Delete.yml index f74c0181..944f77ae 100644 --- a/config/Data/Job/Collection/Delete.yml +++ b/src/Data/Job/Collection/Delete.yml @@ -1,10 +1,12 @@ services: neighborhoods.kojo.data.job.collection.delete: class: Neighborhoods\Kojo\Data\Job\Collection\Delete + public: false + shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job']] - - [addDbConnectionContainer, ['@db.connection.container-job']] - [setIterator, ['@data.job.collection.iterator']] - - [setLogger, ['@process.pool.logger']] data.job.collection.delete: - alias: neighborhoods.kojo.data.job.collection.delete \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.delete + public: false \ No newline at end of file diff --git a/config/Data/Job/Collection/Iterator.yml b/src/Data/Job/Collection/Iterator.yml similarity index 100% rename from config/Data/Job/Collection/Iterator.yml rename to src/Data/Job/Collection/Iterator.yml diff --git a/config/Data/Job/Collection/Schedule/LimitCheck.yml b/src/Data/Job/Collection/Schedule/LimitCheck.yml similarity index 75% rename from config/Data/Job/Collection/Schedule/LimitCheck.yml rename to src/Data/Job/Collection/Schedule/LimitCheck.yml index e6727129..225b675b 100644 --- a/config/Data/Job/Collection/Schedule/LimitCheck.yml +++ b/src/Data/Job/Collection/Schedule/LimitCheck.yml @@ -1,11 +1,12 @@ services: neighborhoods.kojo.data.job.collection.schedule.limitcheck: class: Neighborhoods\Kojo\Data\Job\Collection\Schedule\LimitCheck + public: false shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job']] - [setIterator, ['@data.job.collection.iterator']] - - [addDbConnectionContainer, ['@db.connection.container-job']] - - [setLogger, ['@process.pool.logger']] data.job.collection.schedule.limitcheck: - alias: neighborhoods.kojo.data.job.collection.schedule.limitcheck \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.schedule.limitcheck + public: false \ No newline at end of file diff --git a/src/Data/Job/Collection/ScheduleLimit.php b/src/Data/Job/Collection/ScheduleLimit.php index 7356a1ae..bde20182 100644 --- a/src/Data/Job/Collection/ScheduleLimit.php +++ b/src/Data/Job/Collection/ScheduleLimit.php @@ -26,7 +26,8 @@ protected function &_getRecords(): array if (!$this->_exists(self::PROP_RECORDS)) { $this->_prepareCollection(); $select = $this->getSelect(); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($select); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $statement = $dbConnectionContainer->getStatement($select); /** @var \PDOStatement $pdoStatement */ $pdoStatement = $statement->execute()->getResource(); $pdoStatement->setFetchMode($this->_getFetchMode()); @@ -50,7 +51,8 @@ protected function _prepareCollection(): Db\Model\CollectionAbstract ] ); $this->getSelect()->where->equalTo(JobInterface::FIELD_NAME_TYPE_CODE, $this->_getJobType()->getCode()); - $this->getSelect()->where + $this->getSelect() + ->where ->nest() ->equalTo(JobInterface::FIELD_NAME_ASSIGNED_STATE, State\Service::STATE_WORKING) ->or diff --git a/config/Data/Job/Collection/ScheduleLimit.yml b/src/Data/Job/Collection/ScheduleLimit.yml similarity index 61% rename from config/Data/Job/Collection/ScheduleLimit.yml rename to src/Data/Job/Collection/ScheduleLimit.yml index 05e762b0..65938011 100644 --- a/config/Data/Job/Collection/ScheduleLimit.yml +++ b/src/Data/Job/Collection/ScheduleLimit.yml @@ -1,11 +1,12 @@ services: neighborhoods.kojo.data.job.collection.schedulelimit: class: Neighborhoods\Kojo\Data\Job\Collection\ScheduleLimit + public: false shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job']] - [setIterator, ['@data.job.collection.iterator']] - - [addDbConnectionContainer, ['@db.connection.container-job']] - - [setLogger, ['@process.pool.logger']] data.job.collection.schedulelimit: - alias: neighborhoods.kojo.data.job.collection.schedulelimit \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.schedulelimit + public: false \ No newline at end of file diff --git a/src/Data/Job/Collection/Scheduler.php b/src/Data/Job/Collection/Scheduler.php index 57735db2..6ea29e52 100644 --- a/src/Data/Job/Collection/Scheduler.php +++ b/src/Data/Job/Collection/Scheduler.php @@ -29,7 +29,8 @@ protected function &_getRecords(): array if (!$this->_exists(self::PROP_RECORDS)) { $this->_prepareCollection(); $select = $this->getSelect(); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($select); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $statement = $dbConnectionContainer->getStatement($select); /** @var \PDOStatement $pdoStatement */ $pdoStatement = $statement->execute()->getResource(); $pdoStatement->setFetchMode(\PDO::FETCH_NUM); diff --git a/config/Data/Job/Collection/Scheduler.yml b/src/Data/Job/Collection/Scheduler.yml similarity index 61% rename from config/Data/Job/Collection/Scheduler.yml rename to src/Data/Job/Collection/Scheduler.yml index f9c25fe6..8707a535 100644 --- a/config/Data/Job/Collection/Scheduler.yml +++ b/src/Data/Job/Collection/Scheduler.yml @@ -1,11 +1,12 @@ services: neighborhoods.kojo.data.job.collection.scheduler: class: Neighborhoods\Kojo\Data\Job\Collection\Scheduler + public: false shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job']] - [setIterator, ['@data.job.collection.iterator']] - - [addDbConnectionContainer, ['@db.connection.container-job']] - - [setLogger, ['@process.pool.logger']] data.job.collection.scheduler: - alias: neighborhoods.kojo.data.job.collection.scheduler \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.scheduler + public: false \ No newline at end of file diff --git a/src/Data/Job/Collection/Selector.php b/src/Data/Job/Collection/Selector.php index 759aa009..0b3bf37b 100644 --- a/src/Data/Job/Collection/Selector.php +++ b/src/Data/Job/Collection/Selector.php @@ -31,7 +31,9 @@ protected function &_getRecords(): array $this->_create(self::PROP_RECORDS, []); } $select = $this->getSelect(); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($select); + $statement = $this->_getDbConnectionContainerRepository() + ->get(ContainerInterface::ID_JOB) + ->getStatement($select); /** @var \PDOStatement $pdoStatement */ $pdoStatement = $statement->execute()->getResource(); $pdoStatement->setFetchMode($this->_getFetchMode()); diff --git a/config/Data/Job/Collection/Selector.yml b/src/Data/Job/Collection/Selector.yml similarity index 61% rename from config/Data/Job/Collection/Selector.yml rename to src/Data/Job/Collection/Selector.yml index 5ce37093..c308af70 100644 --- a/config/Data/Job/Collection/Selector.yml +++ b/src/Data/Job/Collection/Selector.yml @@ -1,11 +1,12 @@ services: neighborhoods.kojo.data.job.collection.selector: class: Neighborhoods\Kojo\Data\Job\Collection\Selector + public: false shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job']] - [setIterator, ['@data.job.collection.iterator']] - - [addDbConnectionContainer, ['@db.connection.container-job']] - - [setLogger, ['@process.pool.logger']] data.job.collection.selector: - alias: neighborhoods.kojo.data.job.collection.selector \ No newline at end of file + alias: neighborhoods.kojo.data.job.collection.selector + public: false \ No newline at end of file diff --git a/src/Data/Job/CollectionAbstract.php b/src/Data/Job/CollectionAbstract.php index 5693049c..221b4e1e 100644 --- a/src/Data/Job/CollectionAbstract.php +++ b/src/Data/Job/CollectionAbstract.php @@ -5,12 +5,9 @@ use Neighborhoods\Kojo\Data\Job\Collection\IteratorInterface; use Neighborhoods\Kojo\Db; -use Neighborhoods\Kojo\Process; abstract class CollectionAbstract extends Db\Model\CollectionAbstract { - use Process\Pool\Logger\AwareTrait; - public function setIterator(IteratorInterface $iterator) { $iterator->setCollection($this); @@ -28,14 +25,4 @@ protected function _getIterator(): IteratorInterface { return $this->_read(IteratorInterface::class); } - - protected function _logSelect(): CollectionAbstract - { - if ($this->_hasLogger()) { - $sql = $this->_getDbConnectionContainer(Db\Connection\ContainerInterface::NAME_JOB)->getSql(); - $this->_getLogger()->debug(get_called_class() . ': ' . $sql->buildSqlString($this->getSelect())); - } - - return $this; - } } \ No newline at end of file diff --git a/src/Data/Job/CollectionAbstract.yml b/src/Data/Job/CollectionAbstract.yml new file mode 100644 index 00000000..3b365823 --- /dev/null +++ b/src/Data/Job/CollectionAbstract.yml @@ -0,0 +1,12 @@ +services: + neighborhoods.kojo.data.job.collection_abstract: + class: Neighborhoods\Kojo\Data\Job\CollectionAbstract + abstract: true + public: false + shared: false + calls: + - [setLogger, ['@process.pool.logger']] + - [setDbConnectionContainerRepository, ['@db.connection.container.repository']] + data.job.collection_abstract: + alias: neighborhoods.kojo.data.job.collection_abstract + public: false \ No newline at end of file diff --git a/config/Data/Job/Type.yml b/src/Data/Job/Type.yml similarity index 50% rename from config/Data/Job/Type.yml rename to src/Data/Job/Type.yml index 37bc7049..e87d4b26 100644 --- a/config/Data/Job/Type.yml +++ b/src/Data/Job/Type.yml @@ -1,8 +1,9 @@ services: neighborhoods.kojo.data.job.type: class: Neighborhoods\Kojo\Data\Job\Type + public: false shared: false - calls: - - [addDbConnectionContainer, ['@db.connection.container-job']] + parent: db.model data.job.type: - alias: neighborhoods.kojo.data.job.type \ No newline at end of file + alias: neighborhoods.kojo.data.job.type + public: false \ No newline at end of file diff --git a/config/Data/Job/Type/Collection/Iterator.yml b/src/Data/Job/Type/Collection/Iterator.yml similarity index 100% rename from config/Data/Job/Type/Collection/Iterator.yml rename to src/Data/Job/Type/Collection/Iterator.yml diff --git a/config/Data/Job/Type/Collection/Scheduler.yml b/src/Data/Job/Type/Collection/Scheduler.yml similarity index 82% rename from config/Data/Job/Type/Collection/Scheduler.yml rename to src/Data/Job/Type/Collection/Scheduler.yml index ee41b020..8695de33 100644 --- a/config/Data/Job/Type/Collection/Scheduler.yml +++ b/src/Data/Job/Type/Collection/Scheduler.yml @@ -1,10 +1,12 @@ services: neighborhoods.kojo.data.job.type.collection.scheduler: class: Neighborhoods\Kojo\Data\Job\Type\Collection\Scheduler + public: false shared: false + parent: data.job.collection_abstract calls: - [setModel, ['@data.job.type']] - [setIterator, ['@data.job.type.collection.iterator']] - - [addDbConnectionContainer, ['@db.connection.container-job']] data.job.type.collection.scheduler: - alias: neighborhoods.kojo.data.job.type.collection.scheduler \ No newline at end of file + alias: neighborhoods.kojo.data.job.type.collection.scheduler + public: false \ No newline at end of file diff --git a/src/Db/Connection/Container.php b/src/Db/Connection/Container.php index c40fac98..49fa3a9f 100644 --- a/src/Db/Connection/Container.php +++ b/src/Db/Connection/Container.php @@ -18,7 +18,7 @@ class Container implements ContainerInterface { protected $_connection; - protected $_name; + protected $_id; protected $_sql; protected $_adapter; protected $_pdo; @@ -53,24 +53,24 @@ public function getConnection(): Connection return $this->_connection; } - public function setName(string $name): ContainerInterface + public function setId(string $id): ContainerInterface { - if ($this->_name === null) { - $this->_name = $name; + if ($this->_id === null) { + $this->_id = $id; }else { - throw new \LogicException('Name is already set.'); + throw new \LogicException('ID is already set.'); } return $this; } - public function getName(): string + public function getId(): string { - if ($this->_name === null) { - throw new \LogicException('Name is not set.'); + if ($this->_id === null) { + throw new \LogicException('ID is not set.'); } - return $this->_name; + return $this->_id; } public function getSql(): Sql diff --git a/src/Db/Connection/Container.yml b/src/Db/Connection/Container.yml new file mode 100644 index 00000000..17ca8cd0 --- /dev/null +++ b/src/Db/Connection/Container.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.db.connection.container: + class: Neighborhoods\Kojo\Db\Connection\Container + public: true + shared: false + db.connection.container: + alias: neighborhoods.kojo.db.connection.container + public: true \ No newline at end of file diff --git a/src/Db/Connection/Container/AwareTrait.php b/src/Db/Connection/Container/AwareTrait.php index e035786b..95ba67b2 100644 --- a/src/Db/Connection/Container/AwareTrait.php +++ b/src/Db/Connection/Container/AwareTrait.php @@ -7,26 +7,32 @@ trait AwareTrait { - protected $_dbConnectionContainers = []; + public function setDbConnectionContainer(ContainerInterface $dbConnectionContainer): self + { + $this->_create(ContainerInterface::class, $dbConnectionContainer); - public function addDbConnectionContainer(ContainerInterface $container) + return $this; + } + + protected function _getDbConnectionContainer(): ContainerInterface { - $containerName = $container->getName(); - if (isset($this->_dbConnectionContainers[$containerName])) { - throw new \LogicException('The container [' . $containerName . '] is already set.'); - } + return $this->_read(ContainerInterface::class); + } - $this->_dbConnectionContainers[$container->getName()] = $container; + protected function _getDbConnectionContainerClone(): ContainerInterface + { + return clone $this->_getDbConnectionContainer(); + } - return $this; + protected function _hasDbConnectionContainer(): bool + { + return $this->_exists(ContainerInterface::class); } - protected function _getDbConnectionContainer(string $containerName): ContainerInterface + protected function _unsetDbConnectionContainer(): self { - if (!isset($this->_dbConnectionContainers[$containerName])) { - throw new \LogicException('The container [' . $containerName . '] is not set.'); - } + $this->_delete(ContainerInterface::class); - return $this->_dbConnectionContainers[$containerName]; + return $this; } } \ No newline at end of file diff --git a/src/Db/Connection/Container/Factory.php b/src/Db/Connection/Container/Factory.php new file mode 100644 index 00000000..17fbcd7b --- /dev/null +++ b/src/Db/Connection/Container/Factory.php @@ -0,0 +1,20 @@ +_getDbConnectionContainerClone(); + + return $dbConnectionContainer; + } +} \ No newline at end of file diff --git a/src/Db/Connection/Container/Factory.yml b/src/Db/Connection/Container/Factory.yml new file mode 100644 index 00000000..56bb4b20 --- /dev/null +++ b/src/Db/Connection/Container/Factory.yml @@ -0,0 +1,10 @@ +services: + neighborhoods.kojo.db.connection.container.factory: + class: Neighborhoods\Kojo\Db\Connection\Container\Factory + public: true + shared: true + calls: + - [setDbConnectionContainer, ['@db.connection.container']] + db.connection.container.factory: + alias: neighborhoods.kojo.db.connection.container.factory + public: true \ No newline at end of file diff --git a/src/Db/Connection/Container/Factory/AwareTrait.php b/src/Db/Connection/Container/Factory/AwareTrait.php new file mode 100644 index 00000000..d6e62837 --- /dev/null +++ b/src/Db/Connection/Container/Factory/AwareTrait.php @@ -0,0 +1,38 @@ +_create(FactoryInterface::class, $dbConnectionContainerFactory); + + return $this; + } + + protected function _getDbConnectionContainerFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _getDbConnectionContainerFactoryClone(): FactoryInterface + { + return clone $this->_getDbConnectionContainerFactory(); + } + + protected function _hasDbConnectionContainerFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _unsetDbConnectionContainerFactory(): self + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Db/Connection/Container/FactoryInterface.php b/src/Db/Connection/Container/FactoryInterface.php new file mode 100644 index 00000000..ef167709 --- /dev/null +++ b/src/Db/Connection/Container/FactoryInterface.php @@ -0,0 +1,13 @@ +_containerCollection[$id])) { + throw new \LogicException("Container with ID[$id] is not set."); + } + + return $this->_containerCollection[$id]; + } + + public function add(ContainerInterface $container): RepositoryInterface + { + $id = $container->getId(); + if (isset($this->_containerCollection[$id])) { + throw new \LogicException("Container with ID[$id] is already set."); + } + $this->_containerCollection[$id] = $container; + + return $this; + } + + public function create(string $id): ContainerInterface + { + if (isset($this->_containerCollection[$id])) { + throw new \LogicException("Container with ID[$id] is already set."); + } + + return $this->_containerCollection[$id] = $this->_getDbConnectionContainerFactory()->create()->setId($id); + } +} \ No newline at end of file diff --git a/src/Db/Connection/Container/Repository.yml b/src/Db/Connection/Container/Repository.yml new file mode 100644 index 00000000..87f38ed2 --- /dev/null +++ b/src/Db/Connection/Container/Repository.yml @@ -0,0 +1,13 @@ +services: + neighborhoods.kojo.db.connection.container.repository: + class: Neighborhoods\Kojo\Db\Connection\Container\Repository + public: false + shared: true + calls: + - [add, ["@=service('db.connection.container.factory').create().setId(constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_JOB\"))"]] + - [add, ["@=service('db.connection.container.factory').create().setId(constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_SCHEMA\"))"]] + - [add, ["@=service('db.connection.container.factory').create().setId(constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_STATUS\"))"]] + - [setDbConnectionContainerFactory, ['@db.connection.container.factory']] + db.connection.container.repository: + alias: neighborhoods.kojo.db.connection.container.repository + public: false \ No newline at end of file diff --git a/src/Db/Connection/Container/Repository/AwareTrait.php b/src/Db/Connection/Container/Repository/AwareTrait.php new file mode 100644 index 00000000..4672a4f0 --- /dev/null +++ b/src/Db/Connection/Container/Repository/AwareTrait.php @@ -0,0 +1,38 @@ +_create(RepositoryInterface::class, $dbConnectionContainerRepository); + + return $this; + } + + protected function _getDbConnectionContainerRepository(): RepositoryInterface + { + return $this->_read(RepositoryInterface::class); + } + + protected function _getDbConnectionContainerRepositoryClone(): RepositoryInterface + { + return clone $this->_getDbConnectionContainerRepository(); + } + + protected function _hasDbConnectionContainerRepository(): bool + { + return $this->_exists(RepositoryInterface::class); + } + + protected function _unsetDbConnectionContainerRepository(): self + { + $this->_delete(RepositoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Db/Connection/Container/RepositoryInterface.php b/src/Db/Connection/Container/RepositoryInterface.php new file mode 100644 index 00000000..229148f2 --- /dev/null +++ b/src/Db/Connection/Container/RepositoryInterface.php @@ -0,0 +1,15 @@ +_getLoadSelect($propertyName, $propertyValue); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($select); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $statement = $dbConnectionContainer->getStatement($select); $data = $statement->execute()->current(); if ($data) { @@ -97,7 +100,8 @@ public function hasId(): bool protected function _getLoadSelect($field, $value): Select { - $select = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->select($this->getTableName()); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $select = $dbConnectionContainer->select($this->getTableName()); $select->where([$field => $value]); return $select; @@ -116,9 +120,10 @@ public function save(): ModelInterface public function delete(): ModelInterface { - $delete = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->delete($this->getTableName()); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $delete = $dbConnectionContainer->delete($this->getTableName()); $delete->where([$this->getIdPropertyName() => $this->getId()]); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($delete); + $statement = $dbConnectionContainer->getStatement($delete); $statement->execute(); $this->_emptyPersistentProperties(); @@ -127,11 +132,12 @@ public function delete(): ModelInterface protected function insert(): ModelInterface { - $insert = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->insert($this->getTableName()); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $insert = $dbConnectionContainer->insert($this->getTableName()); $insert->values($this->_readChangedPersistentProperties()); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($insert); + $statement = $dbConnectionContainer->getStatement($insert); $statement->execute(); - $id = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getDriver()->getLastGeneratedValue(); + $id = $dbConnectionContainer->getDriver()->getLastGeneratedValue(); $this->setId((int)$id); $this->_emptyChangedPersistentProperties(); @@ -140,11 +146,12 @@ protected function insert(): ModelInterface protected function update(): ModelInterface { + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); $changedPersistentProperties = $this->_readChangedPersistentProperties(); - $update = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->update($this->getTableName()); + $update = $dbConnectionContainer->update($this->getTableName()); $update->where([$this->getIdPropertyName() => $this->getId()]); $update->set($changedPersistentProperties); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($update); + $statement = $dbConnectionContainer->getStatement($update); $statement->execute(); $this->_emptyChangedPersistentProperties(); diff --git a/src/Db/Model.yml b/src/Db/Model.yml new file mode 100644 index 00000000..b8bc3d71 --- /dev/null +++ b/src/Db/Model.yml @@ -0,0 +1,11 @@ +services: + neighborhoods.kojo.db.model: + class: Neighborhoods\Kojo\Db\Model + public: false + shared: false + abstract: true + calls: + - [setDbConnectionContainerRepository, ['@db.connection.container.repository']] + db.model: + alias: neighborhoods.kojo.db.model + public: false \ No newline at end of file diff --git a/src/Db/Model/CollectionAbstract.php b/src/Db/Model/CollectionAbstract.php index 76b77769..70adb875 100644 --- a/src/Db/Model/CollectionAbstract.php +++ b/src/Db/Model/CollectionAbstract.php @@ -8,12 +8,14 @@ use Neighborhoods\Pylon\Data\Property\Defensive; use Neighborhoods\Kojo\Db; use Zend\Db\Sql\Select; +use Neighborhoods\Kojo\Process; abstract class CollectionAbstract implements CollectionInterface { use Defensive\AwareTrait; use Model\AwareTrait; - use Db\Connection\Container\AwareTrait; + use Process\Pool\Logger\AwareTrait; + use Db\Connection\Container\Repository\AwareTrait; const PROP_SELECT = 'select'; const PROP_MODELS = 'models'; const PROP_RECORDS = 'records'; @@ -22,7 +24,7 @@ abstract class CollectionAbstract implements CollectionInterface public function getSelect(): Select { if (!$this->_exists(self::PROP_SELECT)) { - $dbConnectionContainer = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); $select = $dbConnectionContainer->select($this->_getModel()->getTableName()); $this->_create(self::PROP_SELECT, $select); } @@ -77,7 +79,8 @@ protected function &_getRecords(): array if (!$this->_exists(self::PROP_RECORDS)) { $this->_prepareCollection(); $select = $this->getSelect(); - $statement = $this->_getDbConnectionContainer(ContainerInterface::NAME_JOB)->getStatement($select); + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB); + $statement = $dbConnectionContainer->getStatement($select); /** @var \PDOStatement $pdoStatement */ $pdoStatement = $statement->execute()->getResource(); $pdoStatement->setFetchMode($this->_getFetchMode()); @@ -93,4 +96,14 @@ protected function &_getRecords(): array } abstract protected function _prepareCollection(): CollectionAbstract; + + protected function _logSelect(): CollectionInterface + { + if ($this->_hasLogger()) { + $sql = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB)->getSql(); + $this->_getLogger()->debug(get_called_class() . ': ' . $sql->buildSqlString($this->getSelect())); + } + + return $this; + } } \ No newline at end of file diff --git a/src/Db/Model/CollectionInterface.php b/src/Db/Model/CollectionInterface.php index ead6a6b0..f8834362 100644 --- a/src/Db/Model/CollectionInterface.php +++ b/src/Db/Model/CollectionInterface.php @@ -3,12 +3,12 @@ namespace Neighborhoods\Kojo\Db\Model; -use Neighborhoods\Kojo\Db\Connection\ContainerInterface; +use Neighborhoods\Kojo\Db\Connection\Container\RepositoryInterface; use Zend\Db\Sql\Select; interface CollectionInterface extends \IteratorAggregate { - public function addDbConnectionContainer(ContainerInterface $container); + public function setDbConnectionContainerRepository(RepositoryInterface $dbConnectionContainerRepository); public function getSelect(): Select; diff --git a/src/Db/ModelInterface.php b/src/Db/ModelInterface.php index 17ae0172..b2488e35 100644 --- a/src/Db/ModelInterface.php +++ b/src/Db/ModelInterface.php @@ -3,7 +3,7 @@ namespace Neighborhoods\Kojo\Db; -use Neighborhoods\Kojo\Db\Connection\ContainerInterface; +use Neighborhoods\Kojo\Db\Connection\Container\RepositoryInterface; interface ModelInterface { @@ -31,5 +31,5 @@ public function createPersistentProperties(array $persistentProperties); public function readPersistentProperties(): array; - public function addDbConnectionContainer(ContainerInterface $container); + public function setDbConnectionContainerRepository(RepositoryInterface $repository); } \ No newline at end of file diff --git a/src/Db/Schema/VersionAbstract.php b/src/Db/Schema/VersionAbstract.php index ebc7ab9f..a4a6e86f 100644 --- a/src/Db/Schema/VersionAbstract.php +++ b/src/Db/Schema/VersionAbstract.php @@ -7,18 +7,19 @@ use Neighborhoods\Kojo\Db\Connection\ContainerInterface; use Zend\Db\Adapter\Adapter; use Zend\Db\Sql\SqlInterface; +use Neighborhoods\Pylon\Data\Property\Defensive; abstract class VersionAbstract implements VersionInterface { - use Db\Connection\Container\AwareTrait; + use Defensive\AwareTrait; + use Db\Connection\Container\Repository\AwareTrait; protected $_schemaChanges; public function applySchemaChanges(): VersionInterface { - $this->_getDbConnectionContainer(ContainerInterface::NAME_SCHEMA)->getAdapter()->query( - $this->_getDbConnectionContainer(ContainerInterface::NAME_SCHEMA)->getSql()->buildSqlString( - $this->_getSchemaChanges() - ), + $dbConnectionContainer = $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_SCHEMA); + $dbConnectionContainer->getAdapter()->query( + $dbConnectionContainer->getSql()->buildSqlString($this->_getSchemaChanges()), Adapter::QUERY_MODE_EXECUTE ); diff --git a/config/Db/Setup.yml b/src/Db/Setup.yml similarity index 100% rename from config/Db/Setup.yml rename to src/Db/Setup.yml diff --git a/config/Db/Setup/Schema/Version_0_0_0.yml b/src/Db/Setup/Schema/Version_0_0_0.yml similarity index 72% rename from config/Db/Setup/Schema/Version_0_0_0.yml rename to src/Db/Setup/Schema/Version_0_0_0.yml index 715efc46..e24e654f 100644 --- a/config/Db/Setup/Schema/Version_0_0_0.yml +++ b/src/Db/Setup/Schema/Version_0_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version.0_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_0_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version.0_0_0: alias: neighborhoods.kojo.db.setup.schema.version.0_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_1_0_0.yml b/src/Db/Setup/Schema/Version_1_0_0.yml similarity index 72% rename from config/Db/Setup/Schema/Version_1_0_0.yml rename to src/Db/Setup/Schema/Version_1_0_0.yml index d464b9ce..2cd021fa 100644 --- a/config/Db/Setup/Schema/Version_1_0_0.yml +++ b/src/Db/Setup/Schema/Version_1_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version.1_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_1_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version.1_0_0: alias: neighborhoods.kojo.db.setup.schema.version.1_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_2_0_0.yml b/src/Db/Setup/Schema/Version_2_0_0.yml similarity index 72% rename from config/Db/Setup/Schema/Version_2_0_0.yml rename to src/Db/Setup/Schema/Version_2_0_0.yml index 0add8450..ac575c4c 100644 --- a/config/Db/Setup/Schema/Version_2_0_0.yml +++ b/src/Db/Setup/Schema/Version_2_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version.2_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_2_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version.2_0_0: alias: neighborhoods.kojo.db.setup.schema.version.2_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_3_0_0.yml b/src/Db/Setup/Schema/Version_3_0_0.yml similarity index 72% rename from config/Db/Setup/Schema/Version_3_0_0.yml rename to src/Db/Setup/Schema/Version_3_0_0.yml index 57e4bfb3..40922a9b 100644 --- a/config/Db/Setup/Schema/Version_3_0_0.yml +++ b/src/Db/Setup/Schema/Version_3_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version.3_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_3_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version.3_0_0: alias: neighborhoods.kojo.db.setup.schema.version.3_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_4_0_0.yml b/src/Db/Setup/Schema/Version_4_0_0.yml similarity index 71% rename from config/Db/Setup/Schema/Version_4_0_0.yml rename to src/Db/Setup/Schema/Version_4_0_0.yml index b959a1fe..c3bc7469 100644 --- a/config/Db/Setup/Schema/Version_4_0_0.yml +++ b/src/Db/Setup/Schema/Version_4_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version.4_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_4_0_0 calls: - - [addDbConnectionContainer, ["@neighborhoods.kojo.db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version.4_0_0: alias: neighborhoods.kojo.db.setup.schema.version.4_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_5_0_0.yml b/src/Db/Setup/Schema/Version_5_0_0.yml similarity index 72% rename from config/Db/Setup/Schema/Version_5_0_0.yml rename to src/Db/Setup/Schema/Version_5_0_0.yml index 23a2b61d..af9b1ced 100644 --- a/config/Db/Setup/Schema/Version_5_0_0.yml +++ b/src/Db/Setup/Schema/Version_5_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version.5_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_5_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version.5_0_0: alias: neighborhoods.kojo.db.setup.schema.version.5_0_0 \ No newline at end of file diff --git a/config/Db/Setup/Schema/Version_6_0_0.yml b/src/Db/Setup/Schema/Version_6_0_0.yml similarity index 72% rename from config/Db/Setup/Schema/Version_6_0_0.yml rename to src/Db/Setup/Schema/Version_6_0_0.yml index d0e9b834..7674abe7 100644 --- a/config/Db/Setup/Schema/Version_6_0_0.yml +++ b/src/Db/Setup/Schema/Version_6_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.setup.schema.version_6_0_0: class: Neighborhoods\Kojo\Db\Setup\Schema\Version_6_0_0 calls: - - [addDbConnectionContainer, ['@db.connection.container-schema']] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.setup.schema.version_6_0_0: alias: neighborhoods.kojo.db.setup.schema.version_6_0_0 \ No newline at end of file diff --git a/config/Db/TearDown.yml b/src/Db/TearDown.yml similarity index 100% rename from config/Db/TearDown.yml rename to src/Db/TearDown.yml diff --git a/config/Db/TearDown/Schema/Version_0_0_0.yml b/src/Db/TearDown/Schema/Version_0_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_0_0_0.yml rename to src/Db/TearDown/Schema/Version_0_0_0.yml index 027e440a..7745c2ca 100644 --- a/config/Db/TearDown/Schema/Version_0_0_0.yml +++ b/src/Db/TearDown/Schema/Version_0_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version.0_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_0_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version.0_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version.0_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_1_0_0.yml b/src/Db/TearDown/Schema/Version_1_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_1_0_0.yml rename to src/Db/TearDown/Schema/Version_1_0_0.yml index 014aae1b..b8e65202 100644 --- a/config/Db/TearDown/Schema/Version_1_0_0.yml +++ b/src/Db/TearDown/Schema/Version_1_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version.1_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_1_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version.1_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version.1_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_2_0_0.yml b/src/Db/TearDown/Schema/Version_2_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_2_0_0.yml rename to src/Db/TearDown/Schema/Version_2_0_0.yml index ca26251c..f2f568af 100644 --- a/config/Db/TearDown/Schema/Version_2_0_0.yml +++ b/src/Db/TearDown/Schema/Version_2_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version.2_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_2_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version.2_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version.2_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_3_0_0.yml b/src/Db/TearDown/Schema/Version_3_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_3_0_0.yml rename to src/Db/TearDown/Schema/Version_3_0_0.yml index 43bb384b..46a61317 100644 --- a/config/Db/TearDown/Schema/Version_3_0_0.yml +++ b/src/Db/TearDown/Schema/Version_3_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version.3_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_3_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version.3_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version.3_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_4_0_0.yml b/src/Db/TearDown/Schema/Version_4_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_4_0_0.yml rename to src/Db/TearDown/Schema/Version_4_0_0.yml index 0cb810c0..820a3dc3 100644 --- a/config/Db/TearDown/Schema/Version_4_0_0.yml +++ b/src/Db/TearDown/Schema/Version_4_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version.4_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_4_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version.4_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version.4_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_5_0_0.yml b/src/Db/TearDown/Schema/Version_5_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_5_0_0.yml rename to src/Db/TearDown/Schema/Version_5_0_0.yml index cfd29269..b87dcf38 100644 --- a/config/Db/TearDown/Schema/Version_5_0_0.yml +++ b/src/Db/TearDown/Schema/Version_5_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version.5_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_5_0_0 calls: - - [addDbConnectionContainer, ["@db.connection.container-schema"]] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version.5_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version.5_0_0 \ No newline at end of file diff --git a/config/Db/TearDown/Schema/Version_6_0_0.yml b/src/Db/TearDown/Schema/Version_6_0_0.yml similarity index 73% rename from config/Db/TearDown/Schema/Version_6_0_0.yml rename to src/Db/TearDown/Schema/Version_6_0_0.yml index 9d66f538..7c27a7c0 100644 --- a/config/Db/TearDown/Schema/Version_6_0_0.yml +++ b/src/Db/TearDown/Schema/Version_6_0_0.yml @@ -2,6 +2,6 @@ services: neighborhoods.kojo.db.tear_down.schema.version_6_0_0: class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_6_0_0 calls: - - [addDbConnectionContainer, ['@db.connection.container-schema']] + - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] db.tear_down.schema.version_6_0_0: alias: neighborhoods.kojo.db.tear_down.schema.version_6_0_0 \ No newline at end of file diff --git a/config/dependencies.yml b/src/Dependencies.yml similarity index 100% rename from config/dependencies.yml rename to src/Dependencies.yml diff --git a/src/Environment/Parameters.yml b/src/Environment/Parameters.yml new file mode 100644 index 00000000..6e8579b3 --- /dev/null +++ b/src/Environment/Parameters.yml @@ -0,0 +1,7 @@ +parameters: + env(REDIS_PORT): 6379 + env(REDIS_HOST): 'redis' + env(DATABASE_USERNAME): '' + env(DATABASE_PASSWORD): '' + env(DATABASE_ADAPTER): '' + env(DATABASE_HOST): '' \ No newline at end of file diff --git a/src/Foreman.php b/src/Foreman.php index 75372ef9..24b2636f 100644 --- a/src/Foreman.php +++ b/src/Foreman.php @@ -40,21 +40,18 @@ public function workWorker(): ForemanInterface protected function _workWorker(): ForemanInterface { - $job = $this->_getSelector()->getWorkableJob(); - $this->setJob($job); - $this->_getLocator()->setJob($job); + $this->setJob($this->_getSelector()->getWorkableJob()); + $this->_getLocator()->setJob($this->_getJob()); if (is_callable($this->_getLocator()->getCallable())) { $this->_updateJobAsWorking(); $this->_instantiateWorker(); $this->_updateJobAfterWork(); }else { - $updatePanic = $this->_getServiceUpdatePanicFactory()->create(); - $updatePanic->setJob($job); - $updatePanic->save(); - throw new \RuntimeException('Panicking Job[' . $job->getId() . '].'); + $this->_panicJob(); + $jobId = $this->_getJob()->getId(); + throw new \RuntimeException("Panicking job[$jobId]."); } - $jobSemaphoreResource = $this->_getNewJobOwnerResource($job); - $this->_getSemaphore()->releaseLock($jobSemaphoreResource); + $this->_getSemaphore()->releaseLock($this->_getNewJobOwnerResource($this->_getJob())); if (!$this->_getJobType()->getCanWorkInParallel()) { $this->_publishMessage(); @@ -65,13 +62,10 @@ protected function _workWorker(): ForemanInterface protected function _instantiateWorker(): ForemanInterface { - $job = $this->_getJob(); try{ call_user_func($this->_getLocator()->getCallable()); }catch(\Exception $exception){ - $updateCrash = $this->_getServiceUpdateCrashFactory()->create(); - $updateCrash->setJob($job); - $updateCrash->save(); + $this->_crashJob(); throw $exception; } @@ -80,17 +74,13 @@ protected function _instantiateWorker(): ForemanInterface protected function _updateJobAsWorking(): ForemanInterface { - $job = $this->_getJob(); try{ $updateWork = $this->_getServiceUpdateWorkFactory()->create(); - $updateWork->setJob($job); + $updateWork->setJob($this->_getJob()); $updateWork->save(); }catch(\Exception $exception){ - $updatePanic = $this->_getServiceUpdatePanicFactory()->create(); - $updatePanic->setJob($job); - $updatePanic->save(); - $jobSemaphoreResource = $this->_getNewJobOwnerResource($job); - $this->_getSemaphore()->releaseLock($jobSemaphoreResource); + $this->_panicJob(); + $this->_getSemaphore()->releaseLock($this->_getNewJobOwnerResource($this->_getJob())); throw $exception; } @@ -99,21 +89,18 @@ protected function _updateJobAsWorking(): ForemanInterface protected function _updateJobAfterWork(): ForemanInterface { - $job = $this->_getJob(); if ($this->_getJobType()->getAutoCompleteSuccess()) { $updateCompleteSuccess = $this->_getServiceUpdateCompleteSuccessFactory()->create(); - $updateCompleteSuccess->setJob($job); + $updateCompleteSuccess->setJob($this->_getJob()); $updateCompleteSuccess->save(); }else { $stateService = $this->_getStateServiceClone(); - $job->load(); - $stateService->setJob($job); + $this->_getJob()->load(); + $stateService->setJob($this->_getJob()); if (!$this->_getWorkerJobService()->isRequestApplied() || !$stateService->isValidTransition()) { - $updateCrash = $this->_getServiceUpdateCrashFactory()->create(); - $updateCrash->setJob($job); - $updateCrash->save(); - $message = 'Worker related to Job with ID[' . $job->getId() . '] did not request a next state.'; - throw new \LogicException($message); + $this->_crashJob(); + $jobId = $this->_getJob()->getId(); + throw new \LogicException("Worker related to job with ID[$jobId] did not request a next state."); } } @@ -132,4 +119,22 @@ protected function _getJobType(): Job\TypeInterface { return $this->_getTypeRepository()->getJobType($this->_getJob()->getTypeCode()); } + + protected function _panicJob(): ForemanInterface + { + $updatePanic = $this->_getServiceUpdatePanicFactory()->create(); + $updatePanic->setJob($this->_getJob()); + $updatePanic->save(); + + return $this; + } + + protected function _crashJob(): ForemanInterface + { + $updateCrash = $this->_getServiceUpdateCrashFactory()->create(); + $updateCrash->setJob($this->_getJob()); + $updateCrash->save(); + + return $this; + } } \ No newline at end of file diff --git a/config/Foreman.yml b/src/Foreman.yml similarity index 100% rename from config/Foreman.yml rename to src/Foreman.yml diff --git a/config/Maintainer.yml b/src/Maintainer.yml similarity index 100% rename from config/Maintainer.yml rename to src/Maintainer.yml diff --git a/config/Maintainer/Delete.yml b/src/Maintainer/Delete.yml similarity index 100% rename from config/Maintainer/Delete.yml rename to src/Maintainer/Delete.yml diff --git a/config/Message/Broker/Redis.yml b/src/Message/Broker/Redis.yml similarity index 100% rename from config/Message/Broker/Redis.yml rename to src/Message/Broker/Redis.yml diff --git a/config/Message/Broker/Type/Collection.yml b/src/Message/Broker/Type/Collection.yml similarity index 100% rename from config/Message/Broker/Type/Collection.yml rename to src/Message/Broker/Type/Collection.yml diff --git a/config/Process.yml b/src/Process.yml similarity index 100% rename from config/Process.yml rename to src/Process.yml diff --git a/config/Process/Collection.yml b/src/Process/Collection.yml similarity index 100% rename from config/Process/Collection.yml rename to src/Process/Collection.yml diff --git a/config/Process/Collection/Iterator.yml b/src/Process/Collection/Iterator.yml similarity index 100% rename from config/Process/Collection/Iterator.yml rename to src/Process/Collection/Iterator.yml diff --git a/config/Process/Job.yml b/src/Process/Job.yml similarity index 100% rename from config/Process/Job.yml rename to src/Process/Job.yml diff --git a/config/Process/Job/Required.yml b/src/Process/Job/Required.yml similarity index 100% rename from config/Process/Job/Required.yml rename to src/Process/Job/Required.yml diff --git a/config/Process/Listener/Command.yml b/src/Process/Listener/Command.yml similarity index 100% rename from config/Process/Listener/Command.yml rename to src/Process/Listener/Command.yml diff --git a/config/Process/Listener/Mutex/Redis.yml b/src/Process/Listener/Mutex/Redis.yml similarity index 100% rename from config/Process/Listener/Mutex/Redis.yml rename to src/Process/Listener/Mutex/Redis.yml diff --git a/config/Process/Pool.yml b/src/Process/Pool.yml similarity index 100% rename from config/Process/Pool.yml rename to src/Process/Pool.yml diff --git a/config/Process/Pool/Factory.yml b/src/Process/Pool/Factory.yml similarity index 100% rename from config/Process/Pool/Factory.yml rename to src/Process/Pool/Factory.yml diff --git a/config/Process/Pool/Logger.yml b/src/Process/Pool/Logger.yml similarity index 100% rename from config/Process/Pool/Logger.yml rename to src/Process/Pool/Logger.yml diff --git a/config/Process/Pool/Server.yml b/src/Process/Pool/Server.yml similarity index 100% rename from config/Process/Pool/Server.yml rename to src/Process/Pool/Server.yml diff --git a/config/Process/Pool/Strategy.yml b/src/Process/Pool/Strategy.yml similarity index 100% rename from config/Process/Pool/Strategy.yml rename to src/Process/Pool/Strategy.yml diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index 81e3441c..55b7fb5e 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -31,7 +31,11 @@ public function hasAlarm(): bool public function setAlarm(int $seconds): PoolInterface { - $this->_getLogger()->info('Setting alarm for [' . $seconds . '] seconds.'); + if ($seconds === 0) { + $this->_getLogger()->info("Disabling any existing alarm."); + }else { + $this->_getLogger()->info("Setting alarm for $seconds seconds."); + } pcntl_alarm($seconds); return $this; diff --git a/config/Process/Registry.yml b/src/Process/Registry.yml similarity index 100% rename from config/Process/Registry.yml rename to src/Process/Registry.yml diff --git a/config/Process/Root.yml b/src/Process/Root.yml similarity index 100% rename from config/Process/Root.yml rename to src/Process/Root.yml diff --git a/src/Process/Signal.php b/src/Process/Signal.php index 6ade4d9c..3624026e 100644 --- a/src/Process/Signal.php +++ b/src/Process/Signal.php @@ -37,10 +37,12 @@ public function incrementWaitCount(): SignalInterface public function decrementWaitCount(): SignalInterface { + $this->block(); if ($this->_waitCount === 1) { $this->_processBufferedSignals(); } --$this->_waitCount; + $this->unBlock(); return $this; } @@ -74,10 +76,10 @@ public function handleSignal(int $signalNumber, $signalInformation): void while ($childProcessId = pcntl_wait($status, WNOHANG)) { if ($childProcessId == -1) { $errorMessage = var_export(pcntl_strerror(pcntl_get_last_error()), true); - $this->_getLogger()->notice("Encountered a process control wait error with message[$errorMessage]."); + $this->_getLogger()->notice("Received a process control wait error with message[$errorMessage]."); break; }else { - $this->_getLogger()->info("Handling signal from child process ID[$childProcessId]."); + $this->_getLogger()->info("Child with process ID[$childProcessId] exited with status[$status]."); $childInformation[InformationInterface::SIGNAL_NUMBER] = SIGCHLD; $childInformation[InformationInterface::PROCESS_ID] = $childProcessId; $childInformation[InformationInterface::EXIT_VALUE] = $status; diff --git a/config/Process/Signal.yml b/src/Process/Signal.yml similarity index 100% rename from config/Process/Signal.yml rename to src/Process/Signal.yml diff --git a/config/Process/Signal/Information.yml b/src/Process/Signal/Information.yml similarity index 100% rename from config/Process/Signal/Information.yml rename to src/Process/Signal/Information.yml diff --git a/config/Process/Signal/Information/Factory.yml b/src/Process/Signal/Information/Factory.yml similarity index 100% rename from config/Process/Signal/Information/Factory.yml rename to src/Process/Signal/Information/Factory.yml diff --git a/config/Process/Strategy/ProcessControl.yml b/src/Process/Strategy/ProcessControl.yml similarity index 100% rename from config/Process/Strategy/ProcessControl.yml rename to src/Process/Strategy/ProcessControl.yml diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index e926c6be..c9115cf4 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -18,8 +18,6 @@ abstract class ProcessAbstract implements ProcessInterface use Process\Signal\AwareTrait; use Defensive\AwareTrait; use Logger\AwareTrait; - const PROP_IS_PROCESS_TITLE_SET = 'is_process_title_set'; - const PROP_TITLE_PREFIX = 'title_prefix'; protected function _initialize(): ProcessAbstract { @@ -30,11 +28,13 @@ protected function _initialize(): ProcessAbstract $this->_getLogger()->setProcess($this); if ($this->_hasProcessPool()) { $this->_getProcessPool()->emptyChildProcesses(); + $this->_getProcessPool()->getProcess()->unregisterShutdownMethod(); $this->_unsetProcessPool(); } $this->setProcessPool($this->_getProcessPoolFactory()->create()); $this->_getProcessPool()->setProcess($this); $this->_registerSignalHandlers(); + $this->_registerShutdownMethod(); $this->_getProcessRegistry()->pushProcess($this); $this->_setProcessTitle(); $this->_getProcessSignal()->decrementWaitCount(); @@ -83,13 +83,39 @@ public function handleSignal(InformationInterface $information): HandlerInterfac return $this; } - public function exit(int $exitCode) + public function exit(int $exitCode): void { $this->_getProcessSignal()->block(); + $this->unregisterShutdownMethod(); $this->_getProcessPool()->terminateChildProcesses(); exit($exitCode); } + public function shutdown(): ProcessInterface + { + if ($this->_read(self::PROP_IS_SHUTDOWN_METHOD_ACTIVE)) { + $this->_getLogger()->critical("Shutdown method invoked."); + $this->exit(255); + } + + return $this; + } + + protected function _registerShutdownMethod(): ProcessInterface + { + $this->_create(self::PROP_IS_SHUTDOWN_METHOD_ACTIVE, true); + register_shutdown_function([$this, 'shutdown']); + + return $this; + } + + public function unregisterShutdownMethod(): ProcessInterface + { + $this->_update(self::PROP_IS_SHUTDOWN_METHOD_ACTIVE, false); + + return $this; + } + public function setParentProcessPath(string $parentProcessPath): ProcessInterface { $this->_create(self::PROP_PARENT_PROCESS_PATH, $parentProcessPath); diff --git a/src/ProcessInterface.php b/src/ProcessInterface.php index ff198b45..bee1649d 100644 --- a/src/ProcessInterface.php +++ b/src/ProcessInterface.php @@ -9,18 +9,21 @@ interface ProcessInterface extends HandlerInterface { - const PROP_THROTTLE = 'throttle'; - const PROP_EXIT_CODE = 'exit_code'; - const PROP_PATH = 'path'; - const PROP_TERMINATION_SIGNAL_NUMBER = 'termination_signal_number'; - const PROP_PROCESS_ID = 'process_id'; - const PROP_TYPE_CODE = 'type_code'; - const PROP_UUID = 'uuid'; - const PROP_UUID_MAXIMUM_INTEGER = 'uuid_maximum_integer'; - const PROP_PARENT_PROCESS_ID = 'parent_process_id'; - const PROP_PARENT_PROCESS_PATH = 'parent_process_path'; - const PROP_PARENT_PROCESS_UUID = 'parent_process_uuid'; - const PROP_PARENT_PROCESS_TERMINATION_SIGNAL_NUMBER = 'parent_process_termination_signal_number'; + public const PROP_THROTTLE = 'throttle'; + public const PROP_EXIT_CODE = 'exit_code'; + public const PROP_PATH = 'path'; + public const PROP_TERMINATION_SIGNAL_NUMBER = 'termination_signal_number'; + public const PROP_PROCESS_ID = 'process_id'; + public const PROP_TYPE_CODE = 'type_code'; + public const PROP_UUID = 'uuid'; + public const PROP_UUID_MAXIMUM_INTEGER = 'uuid_maximum_integer'; + public const PROP_PARENT_PROCESS_ID = 'parent_process_id'; + public const PROP_PARENT_PROCESS_PATH = 'parent_process_path'; + public const PROP_PARENT_PROCESS_UUID = 'parent_process_uuid'; + public const PROP_PARENT_PROCESS_TERMINATION_SIGNAL_NUMBER = 'parent_process_termination_signal_number'; + public const PROP_TITLE_PREFIX = 'title_prefix'; + public const PROP_IS_SHUTDOWN_METHOD_ACTIVE = 'is_shutdown_method_active'; + public const PROP_IS_PROCESS_TITLE_SET = 'is_process_title_set'; public function start(): ProcessInterface; @@ -62,5 +65,9 @@ public function getParentProcessTerminationSignalNumber(); public function setParentProcessTerminationSignalNumber(int $parentProcessTerminationSignalNumber); - public function exit(int $exitCode); + public function exit(int $exitCode): void; + + public function shutdown(): ProcessInterface; + + public function unregisterShutdownMethod(): ProcessInterface; } \ No newline at end of file diff --git a/config/Redis.yml b/src/Redis.yml similarity index 100% rename from config/Redis.yml rename to src/Redis.yml diff --git a/config/Redis/Factory.yml b/src/Redis/Factory.yml similarity index 100% rename from config/Redis/Factory.yml rename to src/Redis/Factory.yml diff --git a/config/Redis/Repository.yml b/src/Redis/Repository.yml similarity index 100% rename from config/Redis/Repository.yml rename to src/Redis/Repository.yml diff --git a/config/Scheduler.yml b/src/Scheduler.yml similarity index 100% rename from config/Scheduler.yml rename to src/Scheduler.yml diff --git a/config/Scheduler/Cache.yml b/src/Scheduler/Cache.yml similarity index 100% rename from config/Scheduler/Cache.yml rename to src/Scheduler/Cache.yml diff --git a/config/Scheduler/Time.yml b/src/Scheduler/Time.yml similarity index 100% rename from config/Scheduler/Time.yml rename to src/Scheduler/Time.yml diff --git a/config/Selector.yml b/src/Selector.yml similarity index 100% rename from config/Selector.yml rename to src/Selector.yml diff --git a/config/Semaphore.yml b/src/Semaphore.yml similarity index 100% rename from config/Semaphore.yml rename to src/Semaphore.yml diff --git a/src/Semaphore/AwareTrait.php b/src/Semaphore/AwareTrait.php index 5b90afc7..bf957b11 100644 --- a/src/Semaphore/AwareTrait.php +++ b/src/Semaphore/AwareTrait.php @@ -7,7 +7,7 @@ trait AwareTrait { - public function setSemaphore(SemaphoreInterface $semaphore) + public function setSemaphore(SemaphoreInterface $semaphore): self { $this->_create(SemaphoreInterface::class, $semaphore); @@ -23,4 +23,16 @@ protected function _getSemaphoreClone(): SemaphoreInterface { return clone $this->_getSemaphore(); } + + protected function _hasSemaphore(): bool + { + return $this->_exists(SemaphoreInterface::class); + } + + protected function _unsetSemaphore(): self + { + $this->_delete(SemaphoreInterface::class); + + return $this; + } } \ No newline at end of file diff --git a/config/Semaphore/Mutex/Flock.yml b/src/Semaphore/Mutex/Flock.yml similarity index 100% rename from config/Semaphore/Mutex/Flock.yml rename to src/Semaphore/Mutex/Flock.yml diff --git a/config/Semaphore/Mutex/Redis.yml b/src/Semaphore/Mutex/Redis.yml similarity index 100% rename from config/Semaphore/Mutex/Redis.yml rename to src/Semaphore/Mutex/Redis.yml diff --git a/config/Semaphore/Resource.yml b/src/Semaphore/Resource.yml similarity index 100% rename from config/Semaphore/Resource.yml rename to src/Semaphore/Resource.yml diff --git a/src/Semaphore/Resource/AwareTrait.php b/src/Semaphore/Resource/AwareTrait.php index 57b7f3fb..c2d2b7d3 100644 --- a/src/Semaphore/Resource/AwareTrait.php +++ b/src/Semaphore/Resource/AwareTrait.php @@ -4,6 +4,7 @@ namespace Neighborhoods\Kojo\Semaphore\Resource; use Neighborhoods\Kojo\Semaphore\ResourceInterface; +use Neighborhoods\Kojo\SemaphoreInterface; trait AwareTrait { @@ -23,4 +24,16 @@ protected function _getSemaphoreResourceClone(): ResourceInterface { return clone $this->_read(ResourceInterface::class); } + + protected function _hasSemaphoreResource(): bool + { + return $this->_exists(SemaphoreInterface::class); + } + + protected function _unsetSemaphoreResource(): self + { + $this->_delete(SemaphoreInterface::class); + + return $this; + } } \ No newline at end of file diff --git a/config/Semaphore/Resource/Factory.yml b/src/Semaphore/Resource/Factory.yml similarity index 100% rename from config/Semaphore/Resource/Factory.yml rename to src/Semaphore/Resource/Factory.yml diff --git a/config/Semaphore/Resource/Owner/Job.yml b/src/Semaphore/Resource/Owner/Job.yml similarity index 100% rename from config/Semaphore/Resource/Owner/Job.yml rename to src/Semaphore/Resource/Owner/Job.yml diff --git a/src/Service/Container.php b/src/Service/Container.php index 720590fa..9b593a2d 100644 --- a/src/Service/Container.php +++ b/src/Service/Container.php @@ -3,9 +3,66 @@ namespace Neighborhoods\Kojo\Service; -use Neighborhoods\Pylon\ContainerBuilder; +use Symfony\Component\Config\FileLocator; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Compiler\RepeatedPass; +use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; +use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; class Container { - use ContainerBuilder\AwareTrait; -} + protected $_containerBuilder; + protected $_yamlServicesFilePaths = []; + protected $_rootDirectoryPaths = []; + + public function addRootDirectoryPath(string $rootDirectoryPath): Container + { + if (isset($this->_rootDirectoryPaths[$rootDirectoryPath])) { + throw new \LogicException("Root directory path[$rootDirectoryPath] is already set."); + } + $this->_rootDirectoryPaths[] = $rootDirectoryPath; + + return $this; + } + + protected function _getRootDirectoryPaths(): array + { + return $this->_rootDirectoryPaths; + } + + protected function _getYamlServicesFilePaths(): array + { + if (empty($this->_yamlServicesFilePaths)) { + foreach ($this->_getRootDirectoryPaths() as $rootDirectoryPath) { + $recursiveDirectoryIterator = new \RecursiveDirectoryIterator($rootDirectoryPath); + foreach (new \RecursiveIteratorIterator($recursiveDirectoryIterator) as $file) { + $extension = $file->getExtension(); + if (strtolower($extension) == 'yml') { + $this->_yamlServicesFilePaths[] = $file->getPathname(); + } + } + } + } + + return $this->_yamlServicesFilePaths; + } + + public function getContainerBuilder(): ContainerBuilder + { + if ($this->_containerBuilder === null) { + $containerBuilder = new ContainerBuilder(); + $loader = new YamlFileLoader($containerBuilder, new FileLocator(__DIR__)); + foreach ($this->_getYamlServicesFilePaths() as $servicesYmlFilePath) { + $loader->import($servicesYmlFilePath); + } + $passes = [new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()]; + $repeatedPass = new RepeatedPass($passes); + $repeatedPass->process($containerBuilder); + $containerBuilder->compile(true); + $this->_containerBuilder = $containerBuilder; + } + + return $this->_containerBuilder; + } +} \ No newline at end of file diff --git a/config/Service/Create.yml b/src/Service/Create.yml similarity index 100% rename from config/Service/Create.yml rename to src/Service/Create.yml diff --git a/config/Service/Create/Factory.yml b/src/Service/Create/Factory.yml similarity index 100% rename from config/Service/Create/Factory.yml rename to src/Service/Create/Factory.yml diff --git a/src/Service/Defaults.yml b/src/Service/Defaults.yml new file mode 100644 index 00000000..74bf0d81 --- /dev/null +++ b/src/Service/Defaults.yml @@ -0,0 +1,5 @@ +services: + _defaults: + autowire: false + autoconfigure: false + public: false \ No newline at end of file diff --git a/config/Service/Update/Complete/Failed.yml b/src/Service/Update/Complete/Failed.yml similarity index 100% rename from config/Service/Update/Complete/Failed.yml rename to src/Service/Update/Complete/Failed.yml diff --git a/config/Service/Update/Complete/Failed/Factory.yml b/src/Service/Update/Complete/Failed/Factory.yml similarity index 100% rename from config/Service/Update/Complete/Failed/Factory.yml rename to src/Service/Update/Complete/Failed/Factory.yml diff --git a/config/Service/Update/Complete/FailedScheduleLimitCheck.yml b/src/Service/Update/Complete/FailedScheduleLimitCheck.yml similarity index 100% rename from config/Service/Update/Complete/FailedScheduleLimitCheck.yml rename to src/Service/Update/Complete/FailedScheduleLimitCheck.yml diff --git a/config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml b/src/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml similarity index 100% rename from config/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml rename to src/Service/Update/Complete/FailedScheduleLimitCheck/Factory.yml diff --git a/config/Service/Update/Complete/Success.yml b/src/Service/Update/Complete/Success.yml similarity index 100% rename from config/Service/Update/Complete/Success.yml rename to src/Service/Update/Complete/Success.yml diff --git a/config/Service/Update/Complete/Success/Factory.yml b/src/Service/Update/Complete/Success/Factory.yml similarity index 100% rename from config/Service/Update/Complete/Success/Factory.yml rename to src/Service/Update/Complete/Success/Factory.yml diff --git a/config/Service/Update/Crash.yml b/src/Service/Update/Crash.yml similarity index 100% rename from config/Service/Update/Crash.yml rename to src/Service/Update/Crash.yml diff --git a/config/Service/Update/Crash/Factory.yml b/src/Service/Update/Crash/Factory.yml similarity index 100% rename from config/Service/Update/Crash/Factory.yml rename to src/Service/Update/Crash/Factory.yml diff --git a/config/Service/Update/Hold.yml b/src/Service/Update/Hold.yml similarity index 100% rename from config/Service/Update/Hold.yml rename to src/Service/Update/Hold.yml diff --git a/config/Service/Update/Hold/Factory.yml b/src/Service/Update/Hold/Factory.yml similarity index 100% rename from config/Service/Update/Hold/Factory.yml rename to src/Service/Update/Hold/Factory.yml diff --git a/config/Service/Update/Panic.yml b/src/Service/Update/Panic.yml similarity index 100% rename from config/Service/Update/Panic.yml rename to src/Service/Update/Panic.yml diff --git a/config/Service/Update/Panic/Factory.yml b/src/Service/Update/Panic/Factory.yml similarity index 100% rename from config/Service/Update/Panic/Factory.yml rename to src/Service/Update/Panic/Factory.yml diff --git a/config/Service/Update/Retry.yml b/src/Service/Update/Retry.yml similarity index 100% rename from config/Service/Update/Retry.yml rename to src/Service/Update/Retry.yml diff --git a/config/Service/Update/Retry/Factory.yml b/src/Service/Update/Retry/Factory.yml similarity index 100% rename from config/Service/Update/Retry/Factory.yml rename to src/Service/Update/Retry/Factory.yml diff --git a/config/Service/Update/Wait.yml b/src/Service/Update/Wait.yml similarity index 100% rename from config/Service/Update/Wait.yml rename to src/Service/Update/Wait.yml diff --git a/config/Service/Update/Wait/Factory.yml b/src/Service/Update/Wait/Factory.yml similarity index 100% rename from config/Service/Update/Wait/Factory.yml rename to src/Service/Update/Wait/Factory.yml diff --git a/config/Service/Update/Work.yml b/src/Service/Update/Work.yml similarity index 100% rename from config/Service/Update/Work.yml rename to src/Service/Update/Work.yml diff --git a/config/Service/Update/Work/Factory.yml b/src/Service/Update/Work/Factory.yml similarity index 100% rename from config/Service/Update/Work/Factory.yml rename to src/Service/Update/Work/Factory.yml diff --git a/config/State/Service.yml b/src/State/Service.yml similarity index 100% rename from config/State/Service.yml rename to src/State/Service.yml diff --git a/config/Type/Repository.yml b/src/Type/Repository.yml similarity index 51% rename from config/Type/Repository.yml rename to src/Type/Repository.yml index 6dc12e47..6b3a63ea 100644 --- a/config/Type/Repository.yml +++ b/src/Type/Repository.yml @@ -1,7 +1,7 @@ services: neighborhoods.kojo.type.repository: - class: Neighborhoods\Kojo\Type\Repository - calls: - - [setJobType, ['@data.job.type']] + class: Neighborhoods\Kojo\Type\Repository + calls: + - [setJobType, ['@data.job.type']] type.repository: alias: neighborhoods.kojo.type.repository \ No newline at end of file diff --git a/config/Type/Service/Create.yml b/src/Type/Service/Create.yml similarity index 100% rename from config/Type/Service/Create.yml rename to src/Type/Service/Create.yml diff --git a/config/Worker/Bootstrap.yml b/src/Worker/Bootstrap.yml similarity index 100% rename from config/Worker/Bootstrap.yml rename to src/Worker/Bootstrap.yml diff --git a/src/Worker/BootstrapAbstract.php b/src/Worker/BootstrapAbstract.php index 08738346..11bb639e 100644 --- a/src/Worker/BootstrapAbstract.php +++ b/src/Worker/BootstrapAbstract.php @@ -3,23 +3,24 @@ namespace Neighborhoods\Kojo\Worker; +use Neighborhoods\Kojo\Db\Connection\ContainerInterface; use Neighborhoods\Pylon\Data\Property\Defensive; use Neighborhoods\Kojo\Db\Connection\Container; use Neighborhoods\Kojo\Foreman; abstract class BootstrapAbstract implements BootstrapInterface { - use Container\AwareTrait; + use Container\Repository\AwareTrait; use Foreman\AwareTrait; use Defensive\AwareTrait; const PROP_PDO = 'pdo'; abstract public function instantiate(): BootstrapInterface; - public function setPdo(\PDO $pdo): BootstrapInterface + protected function _setJobPdo(\PDO $pdo): BootstrapInterface { $this->_create(self::PROP_PDO, $pdo); - $this->_getDbConnectionContainer('job')->setPdo($pdo); + $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB)->setPdo($pdo); return $this; } diff --git a/src/Worker/BootstrapAbstract.yml b/src/Worker/BootstrapAbstract.yml new file mode 100644 index 00000000..03ffd2ba --- /dev/null +++ b/src/Worker/BootstrapAbstract.yml @@ -0,0 +1,12 @@ +services: + neighborhoods.kojo.worker.bootstrap_abstract: + class: Neighborhoods\Kojo\Worker\BootstrapAbstract + abstract: true + public: false + shared: false + calls: + - [setForeman, ['@foreman']] + - [setDbConnectionContainerRepository, ['@db.connection.container.repository']] + worker.bootstrap_abstract: + alias: neighborhoods.kojo.worker.bootstrap_abstract + public: false \ No newline at end of file diff --git a/src/Worker/BootstrapInterface.php b/src/Worker/BootstrapInterface.php index 63edbf10..a3e91887 100644 --- a/src/Worker/BootstrapInterface.php +++ b/src/Worker/BootstrapInterface.php @@ -3,13 +3,7 @@ namespace Neighborhoods\Kojo\Worker; -use Neighborhoods\Kojo\Db\Connection\ContainerInterface; - interface BootstrapInterface { - public function addDbConnectionContainer(ContainerInterface $container); - public function instantiate(): BootstrapInterface; - - public function setPdo(\PDO $pdo): BootstrapInterface; } \ No newline at end of file diff --git a/config/Worker/Job/Service.yml b/src/Worker/Job/Service.yml similarity index 100% rename from config/Worker/Job/Service.yml rename to src/Worker/Job/Service.yml diff --git a/config/Worker/Locator.yml b/src/Worker/Locator.yml similarity index 100% rename from config/Worker/Locator.yml rename to src/Worker/Locator.yml From ea368f2a8f5152f330ce88e6e237f3dac220e7d2 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 18 Apr 2018 13:27:49 -0500 Subject: [PATCH 20/44] - use pylon container builder facade and symfony finder - update bootstrap example - update db connection container factory repository DI definition to be more succinct - updates to tests to support new Scaffolding conventions - update to phpunit ^7.0 and db unit ^4.0 - update phpunit.xml.dist, specifically E_ALL --- bin/kojo | 29 +- composer.json | 4 +- composer.lock | 177 +- example/Worker/Bootstrap.php | 2 +- phpunit.xml.dist | 17 +- src/Db/Connection/Container/Repository.yml | 6 +- src/Service/Container.php | 68 - src/Worker/BootstrapAbstract.php | 9 +- .../ForemanInterfaceTest.php | 8 +- .../ForemanInterfaceTest.yml | 2 - .../fixtures/workWorkers}/1_job_types.yml | 0 .../fixtures/workWorkers}/2_jobs.yml | 0 tests/{ => Mock}/Process/Strategy/Mock.php | 0 tests/{ => Mock}/Worker/Mock.php | 0 tests/Unit/MaintainerInterfaceTest.php | 33 - tests/Unit/Process/PooIInterfaceTest.php | 18 - .../Unit/Process/Pool/ServerInterfaceTest.php | 17 - .../Pool/config/ServerInterfaceTest.yml | 2 - tests/Unit/SchedulerInterfaceTest.php | 17 - tests/Unit/SelectorInterfaceTest.php | 17 - tests/Unit/SemaphoreInterfaceTest.php | 27 - tests/Unit/Service/CreateInterfaceTest.php | 20 - .../Service/config/CreateInterfaceTest.yml | 16 - .../CreateInterfaceTest/1_job_types.yml | 23 - .../fixtures/CreateInterfaceTest/2_jobs.yml | 1782 ------- tests/Unit/config/MaintainerInterfaceTest.yml | 2 - tests/Unit/config/SchedulerInterfaceTest.yml | 2 - tests/Unit/config/SelectorInterfaceTest.yml | 6 - tests/Unit/config/SemaphoreInterfaceTest.yml | 2 - .../MaintainerInterfaceTest/1_job_types.yml | 27 - .../MaintainerInterfaceTest/2_jobs.yml | 441 -- .../SchedulerInterfaceTest/1_job_types.yml | 27 - .../SchedulerInterfaceTest/2_jobs.yml | 67 - .../SelectorInterfaceTest/1_job_types.yml | 29 - .../fixtures/SelectorInterfaceTest/2_jobs.yml | 4578 ----------------- tests/config/Process/Strategy/Mock.yml | 3 - tests/config/root.yml | 32 - 37 files changed, 125 insertions(+), 7385 deletions(-) delete mode 100644 src/Service/Container.php rename tests/{Unit => ForemanInterfaceTest}/ForemanInterfaceTest.php (68%) rename tests/{Unit/config => ForemanInterfaceTest}/ForemanInterfaceTest.yml (86%) rename tests/{Unit/fixtures/ForemanInterfaceTest => ForemanInterfaceTest/fixtures/workWorkers}/1_job_types.yml (100%) rename tests/{Unit/fixtures/ForemanInterfaceTest => ForemanInterfaceTest/fixtures/workWorkers}/2_jobs.yml (100%) rename tests/{ => Mock}/Process/Strategy/Mock.php (100%) rename tests/{ => Mock}/Worker/Mock.php (100%) delete mode 100644 tests/Unit/MaintainerInterfaceTest.php delete mode 100644 tests/Unit/Process/PooIInterfaceTest.php delete mode 100644 tests/Unit/Process/Pool/ServerInterfaceTest.php delete mode 100644 tests/Unit/Process/Pool/config/ServerInterfaceTest.yml delete mode 100644 tests/Unit/SchedulerInterfaceTest.php delete mode 100644 tests/Unit/SelectorInterfaceTest.php delete mode 100644 tests/Unit/SemaphoreInterfaceTest.php delete mode 100644 tests/Unit/Service/CreateInterfaceTest.php delete mode 100644 tests/Unit/Service/config/CreateInterfaceTest.yml delete mode 100644 tests/Unit/Service/fixtures/CreateInterfaceTest/1_job_types.yml delete mode 100644 tests/Unit/Service/fixtures/CreateInterfaceTest/2_jobs.yml delete mode 100644 tests/Unit/config/MaintainerInterfaceTest.yml delete mode 100644 tests/Unit/config/SchedulerInterfaceTest.yml delete mode 100644 tests/Unit/config/SelectorInterfaceTest.yml delete mode 100644 tests/Unit/config/SemaphoreInterfaceTest.yml delete mode 100644 tests/Unit/fixtures/MaintainerInterfaceTest/1_job_types.yml delete mode 100644 tests/Unit/fixtures/MaintainerInterfaceTest/2_jobs.yml delete mode 100644 tests/Unit/fixtures/SchedulerInterfaceTest/1_job_types.yml delete mode 100644 tests/Unit/fixtures/SchedulerInterfaceTest/2_jobs.yml delete mode 100644 tests/Unit/fixtures/SelectorInterfaceTest/1_job_types.yml delete mode 100644 tests/Unit/fixtures/SelectorInterfaceTest/2_jobs.yml delete mode 100644 tests/config/Process/Strategy/Mock.yml delete mode 100644 tests/config/root.yml diff --git a/bin/kojo b/bin/kojo index d1f30888..3ca4df93 100755 --- a/bin/kojo +++ b/bin/kojo @@ -1,13 +1,13 @@ #!/usr/bin/env php getMessage(); exit(1); } -$serviceContainer = new Container(); -$ymlServiceFilePath = __DIR__ . '/../src'; -$serviceContainer->addRootDirectoryPath($ymlServiceFilePath); -if (isset($argv[2]) && is_string($argv[2]) && is_file($argv[2])) { - $serviceContainer->addRootDirectoryPath($argv[2]); +$containerBuilderFacade = new Facade(); +$discoverableDirectories[] = __DIR__ . '/../src'; +$finder = new Finder(); +$finder->name('*.yml'); +if (isset($argv[2]) && is_string($argv[2]) && is_dir($argv[2])) { + $discoverableDirectories[] = $argv[2]; }elseif (isset($argv[1]) && is_string($argv[1]) && $argv[1] === Start::OPT_RUN_SERVER) { foreach ($argv as $argument) { if (strstr($argument, Start::OPT_YSDP) !== false) { $ymlServicesFilePath = explode(Start::OPT_YSDP, $argument); - $serviceContainer->addRootDirectoryPath($ymlServicesFilePath[1]); + $discoverableDirectories[] = $ymlServicesFilePath[1]; } } - $server = $serviceContainer->getContainerBuilder()->get('process.pool.server'); + $finder->files()->in($discoverableDirectories); + $containerBuilderFacade->addFinder($finder); + $server = $containerBuilderFacade->getContainerBuilder()->get('process.pool.server'); $server->setParentProcessPath(''); $server->start(); exit(); } -$containerBuilder = $serviceContainer->getContainerBuilder(); +$finder->files()->in($discoverableDirectories); +$containerBuilderFacade->addFinder($finder); +$containerBuilder = $containerBuilderFacade->getContainerBuilder(); $consoleApplication = $containerBuilder->get('neighborhoods.kojo.symfony.component.console.application'); $consoleApplication->run(); diff --git a/composer.json b/composer.json index 0198cedf..ab568d08 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,8 @@ "neighborhoods/pylon": "dev-master" }, "require-dev": { - "phpunit/phpunit": "^6.4", - "phpunit/dbunit": "^3.0", + "phpunit/phpunit": "^7.0", + "phpunit/dbunit": "^4.0", "symfony/finder": "^4.0", "neighborhoods/scaffolding": "dev-master" }, diff --git a/composer.lock b/composer.lock index c3aeb763..b90f1826 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "45be7c4d5e572fff74a1fa6af70e50bc", + "content-hash": "0c105c56ce6dd19c8fe6c4959be27769", "packages": [ { "name": "dragonmantank/cron-expression", @@ -941,16 +941,16 @@ }, { "name": "zendframework/zend-db", - "version": "2.9.2", + "version": "2.9.3", "source": { "type": "git", "url": "https://github.com/zendframework/zend-db.git", - "reference": "1651abb1b33fc8fbd2d78ff9e2abb526cc2cf666" + "reference": "5b4f2c42f94c9f7f4b2f456a0ebe459fab12b3d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-db/zipball/1651abb1b33fc8fbd2d78ff9e2abb526cc2cf666", - "reference": "1651abb1b33fc8fbd2d78ff9e2abb526cc2cf666", + "url": "https://api.github.com/repos/zendframework/zend-db/zipball/5b4f2c42f94c9f7f4b2f456a0ebe459fab12b3d9", + "reference": "5b4f2c42f94c9f7f4b2f456a0ebe459fab12b3d9", "shasum": "" }, "require": { @@ -995,7 +995,7 @@ "db", "zf" ], - "time": "2017-12-11T14:57:52+00:00" + "time": "2018-04-09T13:21:36+00:00" }, { "name": "zendframework/zend-eventmanager", @@ -1053,16 +1053,16 @@ }, { "name": "zendframework/zend-stdlib", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-stdlib.git", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78" + "reference": "10ef03144902d1955f935fff5346ed52f7d99bcc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/debedcfc373a293f9250cc9aa03cf121428c8e78", - "reference": "debedcfc373a293f9250cc9aa03cf121428c8e78", + "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/10ef03144902d1955f935fff5346ed52f7d99bcc", + "reference": "10ef03144902d1955f935fff5346ed52f7d99bcc", "shasum": "" }, "require": { @@ -1071,7 +1071,7 @@ "require-dev": { "athletic/athletic": "~0.1", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "^2.6.2" + "zendframework/zend-coding-standard": "~1.0.0" }, "type": "library", "extra": { @@ -1094,7 +1094,7 @@ "stdlib", "zf2" ], - "time": "2016-09-13T14:38:50+00:00" + "time": "2018-04-12T16:05:42+00:00" } ], "packages-dev": [ @@ -1203,19 +1203,19 @@ "source": { "type": "git", "url": "git@github.com:neighborhoods/Scaffolding.git", - "reference": "2e113f9aafd93886842ba250a3729545a78ccbb3" + "reference": "10d4760414873d8f578afb069c97c49709e6b8bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/2e113f9aafd93886842ba250a3729545a78ccbb3", - "reference": "2e113f9aafd93886842ba250a3729545a78ccbb3", + "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/10d4760414873d8f578afb069c97c49709e6b8bc", + "reference": "10d4760414873d8f578afb069c97c49709e6b8bc", "shasum": "" }, "require": { "neighborhoods/pylon": "dev-master", "php": ">=7.1", - "phpunit/dbunit": "^3.0", - "phpunit/phpunit": "^6.4", + "phpunit/dbunit": "^4.0", + "phpunit/phpunit": "^7.0", "symfony/config": "~4.0.3", "symfony/dependency-injection": "~4.0.3", "symfony/expression-language": "~4.0.3", @@ -1239,7 +1239,7 @@ } ], "description": "Neighborhoods Scaffolding is meant to make the creation of contract testing easy and fast.", - "time": "2018-04-06T19:54:09+00:00" + "time": "2018-04-13T15:39:59+00:00" }, { "name": "phar-io/manifest", @@ -1560,29 +1560,29 @@ }, { "name": "phpunit/dbunit", - "version": "3.0.3", + "version": "4.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/dbunit.git", - "reference": "0fa4329e490480ab957fe7b1185ea0996ca11f44" + "reference": "e77b469c3962b5a563f09a2a989f1c9bd38b8615" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/0fa4329e490480ab957fe7b1185ea0996ca11f44", - "reference": "0fa4329e490480ab957fe7b1185ea0996ca11f44", + "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/e77b469c3962b5a563f09a2a989f1c9bd38b8615", + "reference": "e77b469c3962b5a563f09a2a989f1c9bd38b8615", "shasum": "" }, "require": { "ext-pdo": "*", "ext-simplexml": "*", - "php": "^7.0", - "phpunit/phpunit": "^6.0", + "php": "^7.1", + "phpunit/phpunit": "^7.0", "symfony/yaml": "^3.0 || ^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -1608,44 +1608,44 @@ "testing", "xunit" ], - "time": "2018-01-23T13:32:26+00:00" + "time": "2018-02-07T06:47:59+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "774a82c0c5da4c1c7701790c262035d235ab7856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/774a82c0c5da4c1c7701790c262035d235ab7856", + "reference": "774a82c0c5da4c1c7701790c262035d235ab7856", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", + "php": "^7.1", "phpunit/php-file-iterator": "^1.4.2", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.0-dev" } }, "autoload": { @@ -1671,7 +1671,7 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-04-06T15:39:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1763,28 +1763,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", + "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1799,7 +1799,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -1808,33 +1808,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", + "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1857,20 +1857,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-02-01T13:16:43+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.7", + "version": "7.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "6bd77b57707c236833d2b57b968e403df060c9d9" + "reference": "a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6bd77b57707c236833d2b57b968e403df060c9d9", - "reference": "6bd77b57707c236833d2b57b968e403df060c9d9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9", + "reference": "a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9", "shasum": "" }, "require": { @@ -1882,15 +1882,15 @@ "myclabs/deep-copy": "^1.6.1", "phar-io/manifest": "^1.0.1", "phar-io/version": "^1.0", - "php": "^7.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", + "phpunit/php-code-coverage": "^6.0.1", "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.5", + "phpunit/php-timer": "^2.0", + "phpunit/phpunit-mock-objects": "^6.1.1", "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", + "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", @@ -1898,16 +1898,12 @@ "sebastian/resource-operations": "^1.0", "sebastian/version": "^2.0.1" }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" - }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -1915,7 +1911,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.1-dev" } }, "autoload": { @@ -1941,33 +1937,30 @@ "testing", "xunit" ], - "time": "2018-02-26T07:01:09+00:00" + "time": "2018-04-13T02:28:50+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "5.0.6", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" + "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/70c740bde8fd9ea9ea295be1cd875dd7b267e157", + "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.5", - "php": "^7.0", + "php": "^7.1", "phpunit/php-text-template": "^1.2.1", "sebastian/exporter": "^3.1" }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, "require-dev": { - "phpunit/phpunit": "^6.5" + "phpunit/phpunit": "^7.0" }, "suggest": { "ext-soap": "*" @@ -1975,7 +1968,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -2000,7 +1993,7 @@ "mock", "xunit" ], - "time": "2018-01-06T05:45:45+00:00" + "time": "2018-04-11T04:50:36+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2113,28 +2106,29 @@ }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/e09160918c66281713f1c324c1f4c4c3037ba1e8", + "reference": "e09160918c66281713f1c324c1f4c4c3037ba1e8", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2159,9 +2153,12 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2018-02-01T13:45:15+00:00" }, { "name": "sebastian/environment", diff --git a/example/Worker/Bootstrap.php b/example/Worker/Bootstrap.php index f79ef77c..2ac05af7 100644 --- a/example/Worker/Bootstrap.php +++ b/example/Worker/Bootstrap.php @@ -3,7 +3,6 @@ namespace Neighborhoods\Kojo\Example\Worker; -use Neighborhoods\Kojo\Db\Connection\ContainerInterface; use Neighborhoods\Kojo\Worker\BootstrapAbstract; use Neighborhoods\Kojo\Worker\BootstrapInterface; @@ -13,6 +12,7 @@ public function instantiate(): BootstrapInterface { $pdo = new \PDO('mysql:dbname=kojo;host=mysql', 'root', 'nhdsroot'); $this->_setJobPdo($pdo); + $this->_setSchemaPdo($pdo); return $this; } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ca0fb12a..f4e056ea 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,18 +9,9 @@ failOnWarning="true" > - - - - - - - - - - - - + + + @@ -28,7 +19,7 @@ - + ./tests/* diff --git a/src/Db/Connection/Container/Repository.yml b/src/Db/Connection/Container/Repository.yml index 87f38ed2..3821bce3 100644 --- a/src/Db/Connection/Container/Repository.yml +++ b/src/Db/Connection/Container/Repository.yml @@ -4,10 +4,10 @@ services: public: false shared: true calls: - - [add, ["@=service('db.connection.container.factory').create().setId(constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_JOB\"))"]] - - [add, ["@=service('db.connection.container.factory').create().setId(constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_SCHEMA\"))"]] - - [add, ["@=service('db.connection.container.factory').create().setId(constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_STATUS\"))"]] - [setDbConnectionContainerFactory, ['@db.connection.container.factory']] + - [create, ["@=constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_JOB\")"]] + - [create, ["@=constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_SCHEMA\")"]] + - [create, ["@=constant(\"\\\\Neighborhoods\\\\Kojo\\\\Db\\\\Connection\\\\ContainerInterface::ID_STATUS\")"]] db.connection.container.repository: alias: neighborhoods.kojo.db.connection.container.repository public: false \ No newline at end of file diff --git a/src/Service/Container.php b/src/Service/Container.php deleted file mode 100644 index 9b593a2d..00000000 --- a/src/Service/Container.php +++ /dev/null @@ -1,68 +0,0 @@ -_rootDirectoryPaths[$rootDirectoryPath])) { - throw new \LogicException("Root directory path[$rootDirectoryPath] is already set."); - } - $this->_rootDirectoryPaths[] = $rootDirectoryPath; - - return $this; - } - - protected function _getRootDirectoryPaths(): array - { - return $this->_rootDirectoryPaths; - } - - protected function _getYamlServicesFilePaths(): array - { - if (empty($this->_yamlServicesFilePaths)) { - foreach ($this->_getRootDirectoryPaths() as $rootDirectoryPath) { - $recursiveDirectoryIterator = new \RecursiveDirectoryIterator($rootDirectoryPath); - foreach (new \RecursiveIteratorIterator($recursiveDirectoryIterator) as $file) { - $extension = $file->getExtension(); - if (strtolower($extension) == 'yml') { - $this->_yamlServicesFilePaths[] = $file->getPathname(); - } - } - } - } - - return $this->_yamlServicesFilePaths; - } - - public function getContainerBuilder(): ContainerBuilder - { - if ($this->_containerBuilder === null) { - $containerBuilder = new ContainerBuilder(); - $loader = new YamlFileLoader($containerBuilder, new FileLocator(__DIR__)); - foreach ($this->_getYamlServicesFilePaths() as $servicesYmlFilePath) { - $loader->import($servicesYmlFilePath); - } - $passes = [new AnalyzeServiceReferencesPass(), new InlineServiceDefinitionsPass()]; - $repeatedPass = new RepeatedPass($passes); - $repeatedPass->process($containerBuilder); - $containerBuilder->compile(true); - $this->_containerBuilder = $containerBuilder; - } - - return $this->_containerBuilder; - } -} \ No newline at end of file diff --git a/src/Worker/BootstrapAbstract.php b/src/Worker/BootstrapAbstract.php index 11bb639e..849f45ed 100644 --- a/src/Worker/BootstrapAbstract.php +++ b/src/Worker/BootstrapAbstract.php @@ -13,15 +13,20 @@ abstract class BootstrapAbstract implements BootstrapInterface use Container\Repository\AwareTrait; use Foreman\AwareTrait; use Defensive\AwareTrait; - const PROP_PDO = 'pdo'; abstract public function instantiate(): BootstrapInterface; protected function _setJobPdo(\PDO $pdo): BootstrapInterface { - $this->_create(self::PROP_PDO, $pdo); $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_JOB)->setPdo($pdo); return $this; } + + protected function _setSchemaPdo(\PDO $pdo): BootstrapInterface + { + $this->_getDbConnectionContainerRepository()->get(ContainerInterface::ID_SCHEMA)->setPdo($pdo); + + return $this; + } } \ No newline at end of file diff --git a/tests/Unit/ForemanInterfaceTest.php b/tests/ForemanInterfaceTest/ForemanInterfaceTest.php similarity index 68% rename from tests/Unit/ForemanInterfaceTest.php rename to tests/ForemanInterfaceTest/ForemanInterfaceTest.php index a7fcb8b0..0b368538 100644 --- a/tests/Unit/ForemanInterfaceTest.php +++ b/tests/ForemanInterfaceTest/ForemanInterfaceTest.php @@ -22,21 +22,21 @@ public function workWorkers(): ForemanInterfaceTest protected function _getForeman(): ForemanInterface { - return $this->_getTestContainerBuilder()->get('foreman'); + return $this->_getContainerBuilderFacade()->getContainerBuilder()->get('foreman'); } protected function _getSelector(): SelectorInterface { - return $this->_getTestContainerBuilder()->get('selector'); + return $this->_getContainerBuilderFacade()->getContainerBuilder()->get('selector'); } protected function _getJobProcess(): JobInterface { - return $this->_getTestContainerBuilder()->get('process.job'); + return $this->_getContainerBuilderFacade()->getContainerBuilder()->get('process.job'); } protected function _getRequiredJobProcess(): JobInterface { - return $this->_getTestContainerBuilder()->get('process.job.required'); + return $this->_getContainerBuilderFacade()->getContainerBuilder()->get('process.job.required'); } } \ No newline at end of file diff --git a/tests/Unit/config/ForemanInterfaceTest.yml b/tests/ForemanInterfaceTest/ForemanInterfaceTest.yml similarity index 86% rename from tests/Unit/config/ForemanInterfaceTest.yml rename to tests/ForemanInterfaceTest/ForemanInterfaceTest.yml index 6d19ee7e..f366168a 100644 --- a/tests/Unit/config/ForemanInterfaceTest.yml +++ b/tests/ForemanInterfaceTest/ForemanInterfaceTest.yml @@ -1,5 +1,3 @@ -imports: - - { resource: ../../config/root.yml } services: foreman: public: true diff --git a/tests/Unit/fixtures/ForemanInterfaceTest/1_job_types.yml b/tests/ForemanInterfaceTest/fixtures/workWorkers/1_job_types.yml similarity index 100% rename from tests/Unit/fixtures/ForemanInterfaceTest/1_job_types.yml rename to tests/ForemanInterfaceTest/fixtures/workWorkers/1_job_types.yml diff --git a/tests/Unit/fixtures/ForemanInterfaceTest/2_jobs.yml b/tests/ForemanInterfaceTest/fixtures/workWorkers/2_jobs.yml similarity index 100% rename from tests/Unit/fixtures/ForemanInterfaceTest/2_jobs.yml rename to tests/ForemanInterfaceTest/fixtures/workWorkers/2_jobs.yml diff --git a/tests/Process/Strategy/Mock.php b/tests/Mock/Process/Strategy/Mock.php similarity index 100% rename from tests/Process/Strategy/Mock.php rename to tests/Mock/Process/Strategy/Mock.php diff --git a/tests/Worker/Mock.php b/tests/Mock/Worker/Mock.php similarity index 100% rename from tests/Worker/Mock.php rename to tests/Mock/Worker/Mock.php diff --git a/tests/Unit/MaintainerInterfaceTest.php b/tests/Unit/MaintainerInterfaceTest.php deleted file mode 100644 index 6e28dae4..00000000 --- a/tests/Unit/MaintainerInterfaceTest.php +++ /dev/null @@ -1,33 +0,0 @@ -_getTestContainerBuilder()->get('neighborhoods.kojo.maintainer'); - $maintainer->deleteCompletedJobs(); - - return $this; - } - - public function testUpdatePendingJobs() - { - $maintainer = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.maintainer'); - $maintainer->updatePendingJobs(); - - return $this; - } - - public function testRescheduleCrashedJobs() - { - $maintainer = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.maintainer'); - $maintainer->rescheduleCrashedJobs(); - - return $this; - } -} \ No newline at end of file diff --git a/tests/Unit/Process/PooIInterfaceTest.php b/tests/Unit/Process/PooIInterfaceTest.php deleted file mode 100644 index c08917d3..00000000 --- a/tests/Unit/Process/PooIInterfaceTest.php +++ /dev/null @@ -1,18 +0,0 @@ -_getTestContainerBuilder()->get('neighborhoods.kojo.process.pool.server'); - -// $server->start(); - } -} \ No newline at end of file diff --git a/tests/Unit/Process/Pool/config/ServerInterfaceTest.yml b/tests/Unit/Process/Pool/config/ServerInterfaceTest.yml deleted file mode 100644 index e23396a3..00000000 --- a/tests/Unit/Process/Pool/config/ServerInterfaceTest.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: ../../../..//config/root.yml } \ No newline at end of file diff --git a/tests/Unit/SchedulerInterfaceTest.php b/tests/Unit/SchedulerInterfaceTest.php deleted file mode 100644 index 26ecdac0..00000000 --- a/tests/Unit/SchedulerInterfaceTest.php +++ /dev/null @@ -1,17 +0,0 @@ -_getTestContainerBuilder()->get('neighborhoods.kojo.scheduler'); - $scheduler->scheduleStaticJobs(); - - return $this; - } -} \ No newline at end of file diff --git a/tests/Unit/SelectorInterfaceTest.php b/tests/Unit/SelectorInterfaceTest.php deleted file mode 100644 index d5e8c7b2..00000000 --- a/tests/Unit/SelectorInterfaceTest.php +++ /dev/null @@ -1,17 +0,0 @@ -_getTestContainerBuilder()->get('selector'); - $selector->pick(); - - return $this; - } -} \ No newline at end of file diff --git a/tests/Unit/SemaphoreInterfaceTest.php b/tests/Unit/SemaphoreInterfaceTest.php deleted file mode 100644 index 7d43d5c9..00000000 --- a/tests/Unit/SemaphoreInterfaceTest.php +++ /dev/null @@ -1,27 +0,0 @@ -_getTestContainerBuilder()->get('neighborhoods.kojo.semaphore'); - $resource = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.semaphore.resource-job'); - $job = $this->_getTestContainerBuilder()->get('neighborhoods.kojo.data.job'); - $job->setId(15); - $job->setTypeCode('type_code'); - $job->setCanWorkInParallel(true); - $resourceOwner = $resource->getResourceOwner(); - if ($resourceOwner instanceof Owner\Job) { - $resourceOwner->setJob($job); - } - $semaphore->testAndSetLock($resource); - - return $this; - } -} \ No newline at end of file diff --git a/tests/Unit/Service/CreateInterfaceTest.php b/tests/Unit/Service/CreateInterfaceTest.php deleted file mode 100644 index 40894b62..00000000 --- a/tests/Unit/Service/CreateInterfaceTest.php +++ /dev/null @@ -1,20 +0,0 @@ -_getTestContainerBuilder()->get('neighborhoods.pylon.time'); - $create = $this->_getTestContainerBuilder()->get('service.create'); - $create->setJobTypeCode('type_code_2'); - $create->setWorkAtDateTime($time->getNow()); - $create->save(); - - return $this; - } -} \ No newline at end of file diff --git a/tests/Unit/Service/config/CreateInterfaceTest.yml b/tests/Unit/Service/config/CreateInterfaceTest.yml deleted file mode 100644 index d7f54ac3..00000000 --- a/tests/Unit/Service/config/CreateInterfaceTest.yml +++ /dev/null @@ -1,16 +0,0 @@ -imports: - - { resource: ../../../../../../config/root.yml } -services: - neighborhoods.kojo.db.connection.container-schema: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_SCHEMA]] - - [setPdo, ["@pdo"]] - neighborhoods.kojo.db.connection.container-job: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterfaceNAME_JOB]] - - [setPdo, ["@pdo"]] - pdo: - class: \Pdo - arguments: ['mysql:dbname=kojo;host=mysql', 'root', 'nhdsroot'] \ No newline at end of file diff --git a/tests/Unit/Service/fixtures/CreateInterfaceTest/1_job_types.yml b/tests/Unit/Service/fixtures/CreateInterfaceTest/1_job_types.yml deleted file mode 100644 index cd83cf63..00000000 --- a/tests/Unit/Service/fixtures/CreateInterfaceTest/1_job_types.yml +++ /dev/null @@ -1,23 +0,0 @@ -kojo_job_type: - - - kojo_job_type_id: 1 - type_code: "type_code_1" - name: "Name 1" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - default_importance: 10 - cron_expression: - schedule_limit: 0 - is_enabled: 1 - - - kojo_job_type_id: 2 - type_code: "type_code_2" - name: "Name 2" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 0 - default_importance: 10 - cron_expression: "* * * * *" - schedule_limit: 12 - is_enabled: 1 \ No newline at end of file diff --git a/tests/Unit/Service/fixtures/CreateInterfaceTest/2_jobs.yml b/tests/Unit/Service/fixtures/CreateInterfaceTest/2_jobs.yml deleted file mode 100644 index 700f10dd..00000000 --- a/tests/Unit/Service/fixtures/CreateInterfaceTest/2_jobs.yml +++ /dev/null @@ -1,1782 +0,0 @@ -kojo_job: - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().add(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('P1D')).format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "new" - previous_state: "empty" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 \ No newline at end of file diff --git a/tests/Unit/config/MaintainerInterfaceTest.yml b/tests/Unit/config/MaintainerInterfaceTest.yml deleted file mode 100644 index 1e618df2..00000000 --- a/tests/Unit/config/MaintainerInterfaceTest.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: ../../config/root.yml } \ No newline at end of file diff --git a/tests/Unit/config/SchedulerInterfaceTest.yml b/tests/Unit/config/SchedulerInterfaceTest.yml deleted file mode 100644 index 1e618df2..00000000 --- a/tests/Unit/config/SchedulerInterfaceTest.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: ../../config/root.yml } \ No newline at end of file diff --git a/tests/Unit/config/SelectorInterfaceTest.yml b/tests/Unit/config/SelectorInterfaceTest.yml deleted file mode 100644 index fc762c79..00000000 --- a/tests/Unit/config/SelectorInterfaceTest.yml +++ /dev/null @@ -1,6 +0,0 @@ -imports: - - { resource: ../../config/root.yml } -services: - selector: - public: true - alias: neighborhoods.kojo.selector \ No newline at end of file diff --git a/tests/Unit/config/SemaphoreInterfaceTest.yml b/tests/Unit/config/SemaphoreInterfaceTest.yml deleted file mode 100644 index 1e618df2..00000000 --- a/tests/Unit/config/SemaphoreInterfaceTest.yml +++ /dev/null @@ -1,2 +0,0 @@ -imports: - - { resource: ../../config/root.yml } \ No newline at end of file diff --git a/tests/Unit/fixtures/MaintainerInterfaceTest/1_job_types.yml b/tests/Unit/fixtures/MaintainerInterfaceTest/1_job_types.yml deleted file mode 100644 index 937ad13d..00000000 --- a/tests/Unit/fixtures/MaintainerInterfaceTest/1_job_types.yml +++ /dev/null @@ -1,27 +0,0 @@ -kojo_job_type: - - - kojo_job_type_id: 1 - type_code: "type_code_1" - name: "Name 1" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - default_importance: 10 - cron_expression: - schedule_limit: 0 - is_enabled: 1 - auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' - - - kojo_job_type_id: 2 - type_code: "type_code_2" - name: "Name 2" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 0 - default_importance: 10 - cron_expression: "* * * * *" - schedule_limit: 1 - is_enabled: 1 - auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' \ No newline at end of file diff --git a/tests/Unit/fixtures/MaintainerInterfaceTest/2_jobs.yml b/tests/Unit/fixtures/MaintainerInterfaceTest/2_jobs.yml deleted file mode 100644 index 2f33794a..00000000 --- a/tests/Unit/fixtures/MaintainerInterfaceTest/2_jobs.yml +++ /dev/null @@ -1,441 +0,0 @@ -kojo_job: - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 2" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "pending_limit_check" - previous_state: "new" - worker_uri: "" - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') \ No newline at end of file diff --git a/tests/Unit/fixtures/SchedulerInterfaceTest/1_job_types.yml b/tests/Unit/fixtures/SchedulerInterfaceTest/1_job_types.yml deleted file mode 100644 index 9d13b504..00000000 --- a/tests/Unit/fixtures/SchedulerInterfaceTest/1_job_types.yml +++ /dev/null @@ -1,27 +0,0 @@ -kojo_job_type: - - - kojo_job_type_id: 1 - type_code: "type_code_1" - name: "Name 1" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - default_importance: 10 - cron_expression: - schedule_limit: 0 - is_enabled: 1 - auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' - - - kojo_job_type_id: 2 - type_code: "type_code_2" - name: "Name 2" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 0 - default_importance: 10 - cron_expression: "* * * * *" - schedule_limit: 10 - is_enabled: 1 - auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' \ No newline at end of file diff --git a/tests/Unit/fixtures/SchedulerInterfaceTest/2_jobs.yml b/tests/Unit/fixtures/SchedulerInterfaceTest/2_jobs.yml deleted file mode 100644 index 587a0318..00000000 --- a/tests/Unit/fixtures/SchedulerInterfaceTest/2_jobs.yml +++ /dev/null @@ -1,67 +0,0 @@ -kojo_job: -- - kojo_job_id: 2 - type_code: type_code_2 - name: 'Name 2' - priority: 10 - importance: 10 - status_id: null - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('PT3M')).format('Y-m-d H:i:s') - next_state_request: schedule_limit_check - assigned_state: waiting - previous_state: new - worker_uri: \Neighborhoods\Kojo\Test\Worker\Mock - worker_method: work - can_work_in_parallel: 0 - last_transition_date_time: '2018-01-12 20:54:49' - last_transition_micro_time: 1515790489896748 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') -- - kojo_job_id: 3 - type_code: type_code_2 - name: 'Name 2' - priority: 10 - importance: 10 - status_id: null - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('PT2M')).format('Y-m-d H:i:s') - next_state_request: schedule_limit_check - assigned_state: waiting - previous_state: new - worker_uri: \Neighborhoods\Kojo\Test\Worker\Mock - worker_method: work - can_work_in_parallel: 0 - last_transition_date_time: '2018-01-12 20:54:49' - last_transition_micro_time: 1515790489908615 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') -- - kojo_job_id: 4 - type_code: type_code_2 - name: 'Name 2' - priority: 10 - importance: 10 - status_id: null - work_at_date_time: !fixture/expression: time.getNow().sub(time.getNewDateInterval('PT1M')).format('Y-m-d H:i:s') - next_state_request: schedule_limit_check - assigned_state: waiting - previous_state: new - worker_uri: \Neighborhoods\Kojo\Test\Worker\Mock - worker_method: work - can_work_in_parallel: 0 - last_transition_date_time: '2018-01-12 20:54:49' - last_transition_micro_time: 1515790489914568 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') diff --git a/tests/Unit/fixtures/SelectorInterfaceTest/1_job_types.yml b/tests/Unit/fixtures/SelectorInterfaceTest/1_job_types.yml deleted file mode 100644 index a9944504..00000000 --- a/tests/Unit/fixtures/SelectorInterfaceTest/1_job_types.yml +++ /dev/null @@ -1,29 +0,0 @@ -kojo_job_type: - - - kojo_job_type_id: 1 - type_code: "type_code_1" - name: "Name 1" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - default_importance: 10 - cron_expression: - schedule_limit: 0 - is_enabled: 1 - auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' - process_type_code: 'job' - - - kojo_job_type_id: 2 - type_code: "type_code_2" - name: "Name 2" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 0 - default_importance: 10 - cron_expression: "* * * * *" - schedule_limit: 3 - is_enabled: 1 - auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' - process_type_code: 'job.required' \ No newline at end of file diff --git a/tests/Unit/fixtures/SelectorInterfaceTest/2_jobs.yml b/tests/Unit/fixtures/SelectorInterfaceTest/2_jobs.yml deleted file mode 100644 index 6100ea50..00000000 --- a/tests/Unit/fixtures/SelectorInterfaceTest/2_jobs.yml +++ /dev/null @@ -1,4578 +0,0 @@ -kojo_job: - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "waiting" - previous_state: "new" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job.required' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "waiting" - previous_state: "new" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "working" - assigned_state: "waiting" - previous_state: "new" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_1" - name: "Name 1" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "none" - assigned_state: "working" - previous_state: "waiting" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - - - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') - type_code: "type_code_2" - name: "Name 2" - priority: !fixture/expression: numberPool.getCurrentNumber('job_id') - importance: !fixture/expression: numberPool.getCurrentNumber('job_id') - status_id: !fixture/expression: numberPool.getCurrentNumber('job_id') - work_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - next_state_request: "schedule_limit_check" - assigned_state: "waiting" - previous_state: "new" - worker_uri: '\Neighborhoods\Kojo\Test\Worker\Mock' - worker_method: "work" - can_work_in_parallel: 1 - last_transition_date_time: "2010-04-26 12:14:20" - last_transition_micro_time: 1511915506563849 - times_worked: 0 - times_retried: 0 - times_held: 0 - times_crashed: 0 - times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job.required' \ No newline at end of file diff --git a/tests/config/Process/Strategy/Mock.yml b/tests/config/Process/Strategy/Mock.yml deleted file mode 100644 index a9a37c8b..00000000 --- a/tests/config/Process/Strategy/Mock.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - neighborhoods.kojo.test.process.strategy.mock: - class: Neighborhoods\Kojo\Test\Process\Strategy\Mock diff --git a/tests/config/root.yml b/tests/config/root.yml deleted file mode 100644 index e72821f7..00000000 --- a/tests/config/root.yml +++ /dev/null @@ -1,32 +0,0 @@ -imports: - - { resource: ../../config/root.yml } - - { resource: Process/Strategy/Mock.yml } -services: - neighborhoods.kojo.db.connection.container-schema: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_SCHEMA]] - - [setPdo, ["@pdo"]] - neighborhoods.kojo.db.connection.container-job: - class: Neighborhoods\Kojo\Db\Connection\Container - calls: - - [setName, [!php/const \Neighborhoods\Kojo\Db\Connection\ContainerInterface::NAME_JOB]] - - [setPdo, ["@pdo"]] - pdo: - class: \Pdo - arguments: ['mysql:dbname=kojo;host=mysql', 'root', 'nhdsroot'] - neighborhoods.kojo.process.pool.logger: - class: Neighborhoods\Kojo\Process\Pool\Logger - calls: - - [setIsEnabled, [false]] - db.tear_down: - public: true - alias: neighborhoods.kojo.db.tear_down - db.setup: - public: true - alias: neighborhoods.kojo.db.setup - redis: - public: true - class: \Redis - calls: - - [connect, ['redis', '6379']] \ No newline at end of file From 7dd13166e6ab87ae4842fcb943b42858e2e8afa6 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 18 Apr 2018 14:17:26 -0500 Subject: [PATCH 21/44] - "symfony/finder": "^4.0" in `require` --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ab568d08..d5076ef3 100644 --- a/composer.json +++ b/composer.json @@ -28,12 +28,12 @@ "symfony/cache": "~4.0.3", "symfony/console": "~4.0.3", "ocramius/proxy-manager": "^2.1", + "symfony/finder": "^4.0", "neighborhoods/pylon": "dev-master" }, "require-dev": { "phpunit/phpunit": "^7.0", "phpunit/dbunit": "^4.0", - "symfony/finder": "^4.0", "neighborhoods/scaffolding": "dev-master" }, "bin": [ From 7ba643c7867a36fac3affd7c517eb25a7450081d Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 18 Apr 2018 14:32:15 -0500 Subject: [PATCH 22/44] versions --- composer.json | 16 ++--- composer.lock | 173 +++++++++++++++++++++++++------------------------- 2 files changed, 95 insertions(+), 94 deletions(-) diff --git a/composer.json b/composer.json index d5076ef3..74393b74 100644 --- a/composer.json +++ b/composer.json @@ -18,17 +18,17 @@ ], "require": { "php": ">=7.1", + "symfony/filesystem": "^4.0", + "symfony/config": "^4.0", + "symfony/yaml": "^4.0", + "symfony/dependency-injection": "^4.0", + "symfony/expression-language": "^4.0", + "symfony/cache": "^4.0", + "symfony/console": "^4.0", + "symfony/finder": "^4.0", "zendframework/zend-db": "^2.8", "dragonmantank/cron-expression": "^2.0", - "symfony/filesystem": "~4.0.3", - "symfony/config": "~4.0.3", - "symfony/yaml": "~4.0.3", - "symfony/dependency-injection": "~4.0.3", - "symfony/expression-language": "~4.0.3", - "symfony/cache": "~4.0.3", - "symfony/console": "~4.0.3", "ocramius/proxy-manager": "^2.1", - "symfony/finder": "^4.0", "neighborhoods/pylon": "dev-master" }, "require-dev": { diff --git a/composer.lock b/composer.lock index b90f1826..387b8cce 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "0c105c56ce6dd19c8fe6c4959be27769", + "content-hash": "8ab4eba30edc2b648550deb3e48a2b3d", "packages": [ { "name": "dragonmantank/cron-expression", @@ -61,18 +61,19 @@ "source": { "type": "git", "url": "git@github.com:neighborhoods/pylon.git", - "reference": "e3c5911395e6f9b2a68b79d3e1d985be7e76074d" + "reference": "395e9d30b4ef5ba3e117851be97587464fc101e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neighborhoods/pylon/zipball/e3c5911395e6f9b2a68b79d3e1d985be7e76074d", - "reference": "e3c5911395e6f9b2a68b79d3e1d985be7e76074d", + "url": "https://api.github.com/repos/neighborhoods/pylon/zipball/395e9d30b4ef5ba3e117851be97587464fc101e3", + "reference": "395e9d30b4ef5ba3e117851be97587464fc101e3", "shasum": "" }, "require": { "php": ">=7.1", - "symfony/config": "~4.0.3", - "symfony/dependency-injection": "~4.0.3" + "symfony/config": "^4.0", + "symfony/dependency-injection": "^4.0", + "symfony/finder": "^4.0" }, "type": "library", "autoload": { @@ -90,7 +91,7 @@ } ], "description": "Neighborhoods Pylon is a collection of useful, but most importantly, generic objects.", - "time": "2018-04-04T21:32:23+00:00" + "time": "2018-04-18T19:29:35+00:00" }, { "name": "ocramius/package-versions", @@ -769,6 +770,55 @@ "homepage": "https://symfony.com", "time": "2018-02-22T10:50:29+00:00" }, + { + "name": "symfony/finder", + "version": "v4.0.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", + "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2018-04-04T05:10:37+00:00" + }, { "name": "symfony/polyfill-mbstring", "version": "v1.7.0", @@ -1203,12 +1253,12 @@ "source": { "type": "git", "url": "git@github.com:neighborhoods/Scaffolding.git", - "reference": "10d4760414873d8f578afb069c97c49709e6b8bc" + "reference": "fda6e2b4b314bc8c41c93f5e2fce63222bf40861" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/10d4760414873d8f578afb069c97c49709e6b8bc", - "reference": "10d4760414873d8f578afb069c97c49709e6b8bc", + "url": "https://api.github.com/repos/neighborhoods/Scaffolding/zipball/fda6e2b4b314bc8c41c93f5e2fce63222bf40861", + "reference": "fda6e2b4b314bc8c41c93f5e2fce63222bf40861", "shasum": "" }, "require": { @@ -1216,12 +1266,12 @@ "php": ">=7.1", "phpunit/dbunit": "^4.0", "phpunit/phpunit": "^7.0", - "symfony/config": "~4.0.3", - "symfony/dependency-injection": "~4.0.3", - "symfony/expression-language": "~4.0.3", - "symfony/filesystem": "~4.0.3", + "symfony/config": "^4.0", + "symfony/dependency-injection": "^4.0", + "symfony/expression-language": "^4.0", + "symfony/filesystem": "^4.0", "symfony/finder": "^4.0", - "symfony/yaml": "~4.0.3" + "symfony/yaml": "^4.0" }, "type": "library", "autoload": { @@ -1239,7 +1289,7 @@ } ], "description": "Neighborhoods Scaffolding is meant to make the creation of contract testing easy and fast.", - "time": "2018-04-13T15:39:59+00:00" + "time": "2018-04-18T19:29:54+00:00" }, { "name": "phar-io/manifest", @@ -1497,23 +1547,23 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.5", + "version": "1.7.6", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", + "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { @@ -1556,7 +1606,7 @@ "spy", "stub" ], - "time": "2018-02-19T10:16:54+00:00" + "time": "2018-04-18T13:57:24+00:00" }, { "name": "phpunit/dbunit", @@ -1861,16 +1911,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.1.3", + "version": "7.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9" + "reference": "6d51299e307dc510149e0b7cd1931dd11770e1cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9", - "reference": "a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6d51299e307dc510149e0b7cd1931dd11770e1cb", + "reference": "6d51299e307dc510149e0b7cd1931dd11770e1cb", "shasum": "" }, "require": { @@ -1889,7 +1939,7 @@ "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", "phpunit/phpunit-mock-objects": "^6.1.1", - "sebastian/comparator": "^2.1", + "sebastian/comparator": "^2.1 || ^3.0", "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", @@ -1937,7 +1987,7 @@ "testing", "xunit" ], - "time": "2018-04-13T02:28:50+00:00" + "time": "2018-04-18T13:41:53+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2042,30 +2092,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ed5fd2281113729f1ebcc64d101ad66028aeb3d5", + "reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -2102,7 +2152,7 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-04-18T13:33:00+00:00" }, { "name": "sebastian/diff", @@ -2558,55 +2608,6 @@ "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, - { - "name": "symfony/finder", - "version": "v4.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", - "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-04-04T05:10:37+00:00" - }, { "name": "theseer/tokenizer", "version": "1.1.0", From 1cf6308fbe3d75df7cafcf715482c7df6e57c869 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Fri, 20 Apr 2018 16:25:57 -0500 Subject: [PATCH 23/44] =?UTF-8?q?-=20spelling=20/=20grammar=20updates=20-?= =?UTF-8?q?=20g=C5=8D-g=C5=8D=20ty=20Noah=20-=20default=20PDO=20-=20PDO=20?= =?UTF-8?q?builder=20-=20env=20based=20PDO=20fallback=20via=20symfony=20en?= =?UTF-8?q?v=20DI=20-=20test=20updates=20to=20go=20hand=20in=20hand=20with?= =?UTF-8?q?=20scaffolding=20evolution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Console/Command/Db/Setup/Install.php | 8 +- src/Console/Command/Db/TearDown/Uninstall.php | 5 +- .../Command/Process/Pool/Server/Start.php | 5 +- src/Db/Connection/Container.php | 9 +- src/Db/Connection/Container.yml | 2 + src/Db/Connection/ContainerInterface.php | 3 + src/Db/PDO/Builder.php | 86 +++++++++++++++++++ src/Db/PDO/Builder.yml | 12 +++ src/Db/PDO/Builder/AwareTrait.php | 38 ++++++++ src/Db/PDO/BuilderInterface.php | 17 ++++ src/Db/Setup.yml | 2 + src/Db/TearDown.yml | 4 +- .../ForemanInterfaceTest.yml | 14 ++- tests/{Mock => }/Process/Strategy/Mock.php | 0 tests/{Mock => }/Worker/Mock.php | 0 15 files changed, 193 insertions(+), 12 deletions(-) create mode 100644 src/Db/PDO/Builder.php create mode 100644 src/Db/PDO/Builder.yml create mode 100644 src/Db/PDO/Builder/AwareTrait.php create mode 100644 src/Db/PDO/BuilderInterface.php rename tests/{Mock => }/Process/Strategy/Mock.php (100%) rename tests/{Mock => }/Worker/Mock.php (100%) diff --git a/src/Console/Command/Db/Setup/Install.php b/src/Console/Command/Db/Setup/Install.php index 919882af..55ee7bf6 100644 --- a/src/Console/Command/Db/Setup/Install.php +++ b/src/Console/Command/Db/Setup/Install.php @@ -15,7 +15,7 @@ class Install extends CommandAbstract protected function _configure(): CommandAbstract { $this->setName('db:setup:install'); - $this->setDescription('Installs Kojo to a persistent storage engine.'); + $this->setDescription('Installs Kōjō to a persistent storage engine.'); $this->setHelp($this->_getHelp()); return $this; @@ -25,7 +25,7 @@ public function _execute(): CommandAbstract { $this->_getBootstrap()->instantiate(); $this->_getDbSetup()->install(); - $this->_getOutput()->writeln('Kojo has been successfully installed.'); + $this->_getOutput()->writeln('Kōjō has been successfully installed.'); return $this; } @@ -33,8 +33,8 @@ public function _execute(): CommandAbstract protected function _getHelp(): string { return <<<'EOD' -This command installs a Kojo cluster on a persistent storage engine. -Currently only \PDO compatible storage engines are supported. +This command installs a Kōjō cluster on a persistent storage engine. +Currently, only \PDO compatible storage engines are supported. The client's Bootstrap class will be called prior to setup, and that \PDO class will be used for setup. EOD; } diff --git a/src/Console/Command/Db/TearDown/Uninstall.php b/src/Console/Command/Db/TearDown/Uninstall.php index ccd734ac..aaa2f9aa 100644 --- a/src/Console/Command/Db/TearDown/Uninstall.php +++ b/src/Console/Command/Db/TearDown/Uninstall.php @@ -15,7 +15,7 @@ class Uninstall extends CommandAbstract protected function _configure(): CommandAbstract { $this->setName('db:teardown:uninstall'); - $this->setDescription('Uninstalls Jobs from the persistent storage engine.'); + $this->setDescription('Uninstalls Kōjō and ALL DATA from the persistent storage engine.'); $this->setHelp($this->_getHelp()); return $this; @@ -25,6 +25,7 @@ public function _execute(): CommandAbstract { $this->_getBootstrap()->instantiate(); $this->_getDbTearDown()->uninstall(); + $this->_getOutput()->writeln('Kōjō has been successfully uninstalled.'); return $this; } @@ -34,7 +35,7 @@ protected function _getHelp(): string return <<<'EOD' WARNING: THIS WILL DELETE ALL JOB DATA IN PERSISTENT STORAGE. -This command UNINSTALLS a Jobs cluster from a persistent storage engine. +This command UNINSTALLS a Kōjō cluster from a persistent storage engine. Currently only \PDO compatible storage engines are supported. The client's Bootstrap class will be called prior to setup, and that \PDO class will be used for setup. EOD; diff --git a/src/Console/Command/Process/Pool/Server/Start.php b/src/Console/Command/Process/Pool/Server/Start.php index f23e2205..ce4f4c16 100644 --- a/src/Console/Command/Process/Pool/Server/Start.php +++ b/src/Console/Command/Process/Pool/Server/Start.php @@ -11,10 +11,13 @@ class Start extends CommandAbstract const OPT_SERVICES_YML_DIRECTORY_PATH = 'services-yml-directory-path'; const OPT_YSDP = 'ysdp'; const OPT_RUN_SERVER = '--run-server'; + const NAME = 'process:pool:server:start'; + const NAME_ALIASES = ['gō-gō']; protected function _configure(): CommandAbstract { - $this->setName('process:pool:server:start'); + $this->setName(self::NAME); + $this->setAliases(self::NAME_ALIASES); $this->setDescription('Starts a new process pool server.'); $this->setHelp($this->_getHelp()); $this->addOption( diff --git a/src/Db/Connection/Container.php b/src/Db/Connection/Container.php index 49fa3a9f..a6fcf3b0 100644 --- a/src/Db/Connection/Container.php +++ b/src/Db/Connection/Container.php @@ -3,6 +3,7 @@ namespace Neighborhoods\Kojo\Db\Connection; +use Neighborhoods\Kojo\Db\PDO; use Zend\Db\Adapter\Adapter; use Zend\Db\Adapter\Driver\DriverInterface; use Zend\Db\Adapter\Driver\Pdo\Connection; @@ -14,15 +15,19 @@ use Zend\Db\Sql\Sql; use Zend\Db\Adapter\Driver; use Zend\Db\Sql\Update; +use Neighborhoods\Pylon\Data\Property\Defensive; class Container implements ContainerInterface { + use Defensive\AwareTrait; + use PDO\Builder\AwareTrait; protected $_connection; protected $_id; protected $_sql; protected $_adapter; protected $_pdo; protected $_driver; + protected $_defaultPdo; public function setPdo(\PDO $pdo): ContainerInterface { @@ -35,10 +40,10 @@ public function setPdo(\PDO $pdo): ContainerInterface return $this; } - protected function _getPdo(): \Pdo + protected function _getPdo(): \PDO { if ($this->_pdo === null) { - throw new \LogicException('PDO is not set.'); + $this->_pdo = $this->_getDbPDOBuilder()->getPdo(); } return $this->_pdo; diff --git a/src/Db/Connection/Container.yml b/src/Db/Connection/Container.yml index 17ca8cd0..d5b9048f 100644 --- a/src/Db/Connection/Container.yml +++ b/src/Db/Connection/Container.yml @@ -3,6 +3,8 @@ services: class: Neighborhoods\Kojo\Db\Connection\Container public: true shared: false + calls: + - [setDbPDOBuilder, ['@db.pdo.builder']] db.connection.container: alias: neighborhoods.kojo.db.connection.container public: true \ No newline at end of file diff --git a/src/Db/Connection/ContainerInterface.php b/src/Db/Connection/ContainerInterface.php index fa45e390..22c24876 100644 --- a/src/Db/Connection/ContainerInterface.php +++ b/src/Db/Connection/ContainerInterface.php @@ -3,6 +3,7 @@ namespace Neighborhoods\Kojo\Db\Connection; +use Neighborhoods\Kojo\Db\PDO\BuilderInterface; use Zend\Db\Adapter\Adapter; use Zend\Db\Adapter\Driver\DriverInterface; use Zend\Db\Adapter\Driver\Pdo\Connection; @@ -51,4 +52,6 @@ public function commit(): Connection; public function rollback(): Connection; public function setPdo(\PDO $pdo): ContainerInterface; + + public function setDbPDOBuilder(BuilderInterface $dbPDOBuilder); } \ No newline at end of file diff --git a/src/Db/PDO/Builder.php b/src/Db/PDO/Builder.php new file mode 100644 index 00000000..d9017ee7 --- /dev/null +++ b/src/Db/PDO/Builder.php @@ -0,0 +1,86 @@ +_pdo === null) { + $dsn = $this->_getDataSourceName(); + $userName = $this->_getUserName(); + $password = $this->_getPassword(); + if ($this->_hasOptions()) { + $options = $this->_getOptions(); + }else { + $options = []; + } + $this->_pdo = new \PDO($dsn, $userName, $password, $options); + } + + return $this->_pdo; + } + + public function setDataSourceName(string $dataSourceName): BuilderInterface + { + $this->_create(self::PROP_DATA_SOURCE_NAME, $dataSourceName); + + return $this; + } + + protected function _getDataSourceName(): string + { + return $this->_read(self::PROP_DATA_SOURCE_NAME); + } + + public function setUserName(string $userName): BuilderInterface + { + $this->_create(self::PROP_USER_NAME, $userName); + + return $this; + } + + protected function _getUserName(): string + { + return $this->_read(self::PROP_USER_NAME); + } + + public function setPassword(string $password): BuilderInterface + { + $this->_create(self::PROP_PASSWORD, $password); + + return $this; + } + + protected function _getPassword(): string + { + return $this->_read(self::PROP_PASSWORD); + } + + public function setOptions(array $options): BuilderInterface + { + $this->_create(self::PROP_OPTIONS, $options); + + return $this; + } + + protected function _getOptions(): array + { + return $this->_read(self::PROP_OPTIONS); + } + + protected function _hasOptions(): bool + { + return $this->_exists(self::PROP_OPTIONS); + } +} \ No newline at end of file diff --git a/src/Db/PDO/Builder.yml b/src/Db/PDO/Builder.yml new file mode 100644 index 00000000..ce277973 --- /dev/null +++ b/src/Db/PDO/Builder.yml @@ -0,0 +1,12 @@ +services: + neighborhoods.kojo.db.pdo.builder: + class: Neighborhoods\Kojo\Db\PDO\Builder + public: false + shared: false + calls: + - [setPassword, ['%env(DATABASE_PASSWORD)%']] + - [setUserName, ['%env(DATABASE_USERNAME)%']] + - [setDataSourceName, ['%env(DATABASE_ADAPTER)%:dbname=%env(DATABASE_NAME)%;host=%env(DATABASE_HOST)%']] + db.pdo.builder: + alias: neighborhoods.kojo.db.pdo.builder + public: false \ No newline at end of file diff --git a/src/Db/PDO/Builder/AwareTrait.php b/src/Db/PDO/Builder/AwareTrait.php new file mode 100644 index 00000000..5ba81fba --- /dev/null +++ b/src/Db/PDO/Builder/AwareTrait.php @@ -0,0 +1,38 @@ +_create(BuilderInterface::class, $dbPDOBuilder); + + return $this; + } + + protected function _getDbPDOBuilder(): BuilderInterface + { + return $this->_read(BuilderInterface::class); + } + + protected function _getDbPDOBuilderClone(): BuilderInterface + { + return clone $this->_getDbPDOBuilder(); + } + + protected function _hasDbPDOBuilder(): bool + { + return $this->_exists(BuilderInterface::class); + } + + protected function _unsetDbPDOBuilder(): self + { + $this->_delete(BuilderInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Db/PDO/BuilderInterface.php b/src/Db/PDO/BuilderInterface.php new file mode 100644 index 00000000..3fb1a611 --- /dev/null +++ b/src/Db/PDO/BuilderInterface.php @@ -0,0 +1,17 @@ + Date: Mon, 30 Apr 2018 11:57:07 -0500 Subject: [PATCH 24/44] =?UTF-8?q?updates=20toward=20v1=20-=20example=20wor?= =?UTF-8?q?ker=20is=20Worker=20Service=20Aware=20-=20API=20Job=20Scheduler?= =?UTF-8?q?=20Factory=20-=20API=20Scheduler=20-=20Job=20Type=20Registrar?= =?UTF-8?q?=20and=20Factory=20-=20Job=20Type=20Service=20allows=20the=20cr?= =?UTF-8?q?eation=20of=20Job=20Types=20outside=20teh=20context=20of=20the?= =?UTF-8?q?=20K=C5=8Dj=C5=8D=20server=20-=20API=20Logger=20and=20interface?= =?UTF-8?q?=20-=20API=20Job=20Service=20-=20API=20Worker=20Service=20-=20U?= =?UTF-8?q?ninstall=20command=20safety=20prompt=20-=20built=20a=20job=20ty?= =?UTF-8?q?pe=20property=20and=20logic=20for=20a=20schedule=20limit=20allo?= =?UTF-8?q?wance=20that=20proves=20a=20way=20to=20buffer=20schedule=5Flimi?= =?UTF-8?q?t=5Fcheck=20jobs=20for=20the=20linear=20clone=20pattern=20-=20r?= =?UTF-8?q?emoved=20process=20type=20code=20(use=20importance=20instead).?= =?UTF-8?q?=20removed=20job=20required=20-=20removed=20sqs=20autoschedule?= =?UTF-8?q?=20in=20favor=20of=20linear=20clone=20pattern=20LCP=20-=20most?= =?UTF-8?q?=20recent=20hostname=20-=20most=20recent=20process=20ID=20-=20u?= =?UTF-8?q?pdated=20K=C5=8Dj=C5=8D=20runtime=20exception.=20removed=20exce?= =?UTF-8?q?ption=20trait=20-=20created=20a=20Locator=20runtime=20exception?= =?UTF-8?q?=20-=20upgraded=20message=20broker=20exceptions=20to=20critical?= =?UTF-8?q?=20-=20updated=20tests=20-=20optimized=20requests=20for=20help?= =?UTF-8?q?=20from=20foreman=20-=20other=20things?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Worker.php | 6 + src/Api/V1/Job/Scheduler.php | 44 + src/Api/V1/Job/Scheduler.yml | 8 + src/Api/V1/Job/Scheduler/AwareTrait.php | 38 + src/Api/V1/Job/Scheduler/Factory.php | 23 + src/Api/V1/Job/Scheduler/Factory.yml | 11 + .../V1/Job/Scheduler/Factory/AwareTrait.php | 38 + src/Api/V1/Job/Scheduler/FactoryInterface.php | 18 + src/Api/V1/Job/SchedulerInterface.php | 22 + src/Api/V1/Job/Type/Registrar.php | 102 + src/Api/V1/Job/Type/Registrar.yml | 10 + src/Api/V1/Job/Type/Registrar/AwareTrait.php | 38 + src/Api/V1/Job/Type/Registrar/Factory.php | 19 + src/Api/V1/Job/Type/Registrar/Factory.yml | 10 + .../Job/Type/Registrar/Factory/AwareTrait.php | 38 + .../Job/Type/Registrar/FactoryInterface.php | 11 + src/Api/V1/Job/Type/RegistrarInterface.php | 33 + src/Api/V1/Job/Type/Service.php | 41 + src/Api/V1/Job/Type/ServiceInterface.php | 9 + src/Api/V1/Logger.php | 65 + src/Api/V1/Logger/AwareTrait.php | 38 + src/Api/V1/LoggerInterface.php | 8 + src/Api/V1/Worker/Job/Service/AwareTrait.php | 34 - src/Api/V1/Worker/Job/ServiceInterface.php | 34 - src/{Worker/Job => Api/V1/Worker}/Service.php | 35 +- src/{Worker/Job => Api/V1/Worker}/Service.yml | 10 +- src/Api/V1/Worker/Service/AwareTrait.php | 33 + .../V1/Worker}/ServiceInterface.php | 16 +- src/AutoSchedule/Sqs/Worker.php | 17 - src/AutoSchedule/Sqs/WorkerInterface.php | 9 - src/Console/Command/Db/Setup/Install.php | 5 +- src/Console/Command/Db/TearDown/Uninstall.php | 69 +- .../Command/Process/Pool/Server/Start.php | 8 +- src/Console/CommandAbstract.php | 2 +- src/Data/AutoSchedule/Sqs.php | 44 - src/Data/AutoSchedule/Sqs/AwareTrait.php | 38 - src/Data/AutoSchedule/SqsInterface.php | 24 - src/Data/Job.php | 20 +- src/Data/Job/Collection/ScheduleLimit.php | 11 +- .../Job/Collection/ScheduleLimitInterface.php | 2 + src/Data/Job/Collection/Selector.php | 2 - src/Data/Job/Type.php | 27 +- src/Data/Job/TypeInterface.php | 36 +- src/Data/JobInterface.php | 69 +- src/Db/Setup.yml | 1 - src/Db/Setup/Schema/Version_4_0_0.php | 15 +- src/Db/Setup/Schema/Version_5_0_0.php | 12 +- src/Db/Setup/Schema/Version_6_0_0.php | 60 - src/Db/Setup/Schema/Version_6_0_0.yml | 7 - src/Db/TearDown.yml | 1 - src/Db/TearDown/Schema/Version_6_0_0.php | 20 - src/Db/TearDown/Schema/Version_6_0_0.yml | 7 - src/Exception/ExceptionTrait.php | 92 - src/Exception/Runtime/Exception.php | 91 +- src/Exception/Runtime/ExceptionInterface.php | 16 + src/Foreman.php | 30 +- src/Foreman.yml | 2 +- src/ForemanInterface.php | 4 +- src/Maintainer.php | 14 +- src/Message/Broker/Redis.php | 12 +- src/Process/Collection.yml | 1 - src/Process/Forked.php | 2 +- src/Process/Job.php | 18 +- src/Process/Job/Required.php | 11 - src/Process/Job/Required.yml | 21 - src/ProcessAbstract.php | 17 +- src/ProcessInterface.php | 2 +- src/Scheduler.php | 2 +- src/Selector.php | 12 +- src/Service/Create.php | 12 +- src/Service/Create/Factory.php | 1 - .../Service/Create/Factory/AwareTrait.php | 4 +- .../Service/Create/FactoryInterface.php | 2 +- src/Type/Service/Create.php | 7 + src/Type/Service/Create/Factory.php | 1 - .../Service/Create/Factory/AwareTrait.php | 4 +- .../Type/Service/Create/FactoryInterface.php | 2 +- src/Worker/Job/Service/AwareTrait.php | 26 - src/Worker/Locator.php | 33 +- src/Worker/Locator/Exception.php | 16 + src/Worker/Locator/ExceptionInterface.php | 11 + src/Worker/LocatorInterface.php | 4 + tests/Application/Db/PDO/Builder.yml | 4 + tests/Application/Db/Setup.yml | 4 + tests/Application/Db/TearDown.yml | 4 + tests/Application/Foreman.yml | 4 + tests/Application/Process/Job.yml | 4 + .../Process/Strategy/Mock.php | 2 +- tests/Application/Redis/Factory.yml | 4 + tests/Application/Selector.yml | 4 + tests/{ => Application}/Worker/Mock.php | 2 +- tests/BehaviorSmokeTest/BehaviorSmokeTest.php | 15 + .../fixtures/dataSet1/1_job_types.yml | 29 + .../fixtures/dataSet1/2_jobs.yml | 4379 +++++++++++++++++ .../ForemanInterfaceTest.php | 5 - .../ForemanInterfaceTest.yml | 25 - .../fixtures/workWorkers/1_job_types.yml | 6 +- .../fixtures/workWorkers/2_jobs.yml | 201 +- 98 files changed, 5592 insertions(+), 868 deletions(-) create mode 100644 src/Api/V1/Job/Scheduler.php create mode 100644 src/Api/V1/Job/Scheduler.yml create mode 100644 src/Api/V1/Job/Scheduler/AwareTrait.php create mode 100644 src/Api/V1/Job/Scheduler/Factory.php create mode 100644 src/Api/V1/Job/Scheduler/Factory.yml create mode 100644 src/Api/V1/Job/Scheduler/Factory/AwareTrait.php create mode 100644 src/Api/V1/Job/Scheduler/FactoryInterface.php create mode 100644 src/Api/V1/Job/SchedulerInterface.php create mode 100644 src/Api/V1/Job/Type/Registrar.php create mode 100644 src/Api/V1/Job/Type/Registrar.yml create mode 100644 src/Api/V1/Job/Type/Registrar/AwareTrait.php create mode 100644 src/Api/V1/Job/Type/Registrar/Factory.php create mode 100644 src/Api/V1/Job/Type/Registrar/Factory.yml create mode 100644 src/Api/V1/Job/Type/Registrar/Factory/AwareTrait.php create mode 100644 src/Api/V1/Job/Type/Registrar/FactoryInterface.php create mode 100644 src/Api/V1/Job/Type/RegistrarInterface.php create mode 100644 src/Api/V1/Job/Type/Service.php create mode 100644 src/Api/V1/Job/Type/ServiceInterface.php create mode 100644 src/Api/V1/Logger.php create mode 100644 src/Api/V1/Logger/AwareTrait.php create mode 100644 src/Api/V1/LoggerInterface.php delete mode 100644 src/Api/V1/Worker/Job/Service/AwareTrait.php delete mode 100644 src/Api/V1/Worker/Job/ServiceInterface.php rename src/{Worker/Job => Api/V1/Worker}/Service.php (75%) rename src/{Worker/Job => Api/V1/Worker}/Service.yml (60%) create mode 100644 src/Api/V1/Worker/Service/AwareTrait.php rename src/{Worker/Job => Api/V1/Worker}/ServiceInterface.php (77%) delete mode 100644 src/AutoSchedule/Sqs/Worker.php delete mode 100644 src/AutoSchedule/Sqs/WorkerInterface.php delete mode 100644 src/Data/AutoSchedule/Sqs.php delete mode 100644 src/Data/AutoSchedule/Sqs/AwareTrait.php delete mode 100644 src/Data/AutoSchedule/SqsInterface.php delete mode 100644 src/Db/Setup/Schema/Version_6_0_0.php delete mode 100644 src/Db/Setup/Schema/Version_6_0_0.yml delete mode 100644 src/Db/TearDown/Schema/Version_6_0_0.php delete mode 100644 src/Db/TearDown/Schema/Version_6_0_0.yml delete mode 100644 src/Exception/ExceptionTrait.php create mode 100644 src/Exception/Runtime/ExceptionInterface.php delete mode 100644 src/Process/Job/Required.php delete mode 100644 src/Process/Job/Required.yml rename src/{Api/V1 => }/Service/Create/Factory/AwareTrait.php (84%) rename src/{Api/V1 => }/Service/Create/FactoryInterface.php (93%) rename src/{Api/V1 => }/Type/Service/Create/Factory/AwareTrait.php (83%) rename src/{Api/V1 => }/Type/Service/Create/FactoryInterface.php (80%) delete mode 100644 src/Worker/Job/Service/AwareTrait.php create mode 100644 src/Worker/Locator/Exception.php create mode 100644 src/Worker/Locator/ExceptionInterface.php create mode 100644 tests/Application/Db/PDO/Builder.yml create mode 100644 tests/Application/Db/Setup.yml create mode 100644 tests/Application/Db/TearDown.yml create mode 100644 tests/Application/Foreman.yml create mode 100644 tests/Application/Process/Job.yml rename tests/{ => Application}/Process/Strategy/Mock.php (74%) create mode 100644 tests/Application/Redis/Factory.yml create mode 100644 tests/Application/Selector.yml rename tests/{ => Application}/Worker/Mock.php (66%) create mode 100644 tests/BehaviorSmokeTest/BehaviorSmokeTest.php create mode 100644 tests/BehaviorSmokeTest/fixtures/dataSet1/1_job_types.yml create mode 100644 tests/BehaviorSmokeTest/fixtures/dataSet1/2_jobs.yml delete mode 100644 tests/ForemanInterfaceTest/ForemanInterfaceTest.yml diff --git a/example/Worker.php b/example/Worker.php index 3ab235a9..b9eb6953 100644 --- a/example/Worker.php +++ b/example/Worker.php @@ -3,8 +3,14 @@ namespace Neighborhoods\Kojo\Example; +use Neighborhoods\Kojo\Api; +use Neighborhoods\Pylon\Data\Property; + class Worker { + use Api\V1\Worker\Service\AwareTrait; + use Property\Defensive\AwareTrait; + public function work() { return $this; diff --git a/src/Api/V1/Job/Scheduler.php b/src/Api/V1/Job/Scheduler.php new file mode 100644 index 00000000..56262ee9 --- /dev/null +++ b/src/Api/V1/Job/Scheduler.php @@ -0,0 +1,44 @@ +_getServiceCreate()->setJobTypeCode($jobTypeCode); + + return $this; + } + + public function setImportance(int $importance): SchedulerInterface + { + $this->_getServiceCreate()->setImportance($importance); + + return $this; + } + + public function setWorkAtDateTime(\DateTime $workAtDateTime): SchedulerInterface + { + $this->_getServiceCreate()->setWorkAtDateTime($workAtDateTime); + + return $this; + } + + public function getJobId(): int + { + return $this->_getServiceCreate()->getJobId(); + } + + public function save(): SchedulerInterface + { + $this->_getServiceCreate()->save(); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Scheduler.yml b/src/Api/V1/Job/Scheduler.yml new file mode 100644 index 00000000..fac67cf7 --- /dev/null +++ b/src/Api/V1/Job/Scheduler.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.api.v1.job.scheduler: + class: Neighborhoods\Kojo\Api\V1\Job\Scheduler + public: false + shared: false + api.v1.job.scheduler: + alias: neighborhoods.kojo.api.v1.job.scheduler + public: false \ No newline at end of file diff --git a/src/Api/V1/Job/Scheduler/AwareTrait.php b/src/Api/V1/Job/Scheduler/AwareTrait.php new file mode 100644 index 00000000..109e8a7a --- /dev/null +++ b/src/Api/V1/Job/Scheduler/AwareTrait.php @@ -0,0 +1,38 @@ +_create(SchedulerInterface::class, $apiV1JobScheduler); + + return $this; + } + + protected function _getApiV1JobScheduler(): SchedulerInterface + { + return $this->_read(SchedulerInterface::class); + } + + protected function _getApiV1JobSchedulerClone(): SchedulerInterface + { + return clone $this->_getApiV1JobScheduler(); + } + + protected function _hasApiV1JobScheduler(): bool + { + return $this->_exists(SchedulerInterface::class); + } + + protected function _unsetApiV1JobScheduler(): self + { + $this->_delete(SchedulerInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Scheduler/Factory.php b/src/Api/V1/Job/Scheduler/Factory.php new file mode 100644 index 00000000..acbd2528 --- /dev/null +++ b/src/Api/V1/Job/Scheduler/Factory.php @@ -0,0 +1,23 @@ +_getApiV1JobSchedulerClone(); + $apiV1JobScheduler->setServiceCreate($this->_getServiceCreateFactory()->create()); + + return $apiV1JobScheduler; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Scheduler/Factory.yml b/src/Api/V1/Job/Scheduler/Factory.yml new file mode 100644 index 00000000..7f0bed69 --- /dev/null +++ b/src/Api/V1/Job/Scheduler/Factory.yml @@ -0,0 +1,11 @@ +services: + neighborhoods.kojo.api.v1.job.scheduler.factory: + class: Neighborhoods\Kojo\Api\V1\Job\Scheduler\Factory + public: false + shared: true + calls: + - [setServiceCreateFactory, ['@service.create.factory']] + - [setApiV1JobScheduler, ['@api.v1.job.scheduler']] + api.v1.job.scheduler.factory: + alias: neighborhoods.kojo.api.v1.job.scheduler.factory + public: false \ No newline at end of file diff --git a/src/Api/V1/Job/Scheduler/Factory/AwareTrait.php b/src/Api/V1/Job/Scheduler/Factory/AwareTrait.php new file mode 100644 index 00000000..b74c6095 --- /dev/null +++ b/src/Api/V1/Job/Scheduler/Factory/AwareTrait.php @@ -0,0 +1,38 @@ +_create(FactoryInterface::class, $apiV1JobSchedulerFactory); + + return $this; + } + + protected function _getApiV1JobSchedulerFactoryClone(): FactoryInterface + { + return clone $this->_getApiV1JobSchedulerFactory(); + } + + protected function _getApiV1JobSchedulerFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _hasApiV1JobSchedulerFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _unsetApiV1JobSchedulerFactory(): self + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Scheduler/FactoryInterface.php b/src/Api/V1/Job/Scheduler/FactoryInterface.php new file mode 100644 index 00000000..8cf25ffb --- /dev/null +++ b/src/Api/V1/Job/Scheduler/FactoryInterface.php @@ -0,0 +1,18 @@ +_getTypeServiceCreate()->save(); + + return $this; + } + + public function setCode(string $code): RegistrarInterface + { + $this->_getTypeServiceCreate()->setCode($code); + + return $this; + } + + public function setWorkerClassUri(string $workerModelUri): RegistrarInterface + { + $this->_getTypeServiceCreate()->setWorkerClassUri($workerModelUri); + + return $this; + } + + public function setWorkerMethod(string $workerMethod): RegistrarInterface + { + $this->_getTypeServiceCreate()->setWorkerMethod($workerMethod); + + return $this; + } + + public function setName(string $name): RegistrarInterface + { + $this->_getTypeServiceCreate()->setName($name); + + return $this; + } + + public function setCronExpression(string $cronExpression): RegistrarInterface + { + $this->_getTypeServiceCreate()->setCronExpression($cronExpression); + + return $this; + } + + public function setCanWorkInParallel(bool $canWorkInParallel): RegistrarInterface + { + $this->_getTypeServiceCreate()->setCanWorkInParallel($canWorkInParallel); + + return $this; + } + + public function setDefaultImportance(int $defaultImportance): RegistrarInterface + { + $this->_getTypeServiceCreate()->setDefaultImportance($defaultImportance); + + return $this; + } + + public function setScheduleLimit(int $scheduleLimit): RegistrarInterface + { + $this->_getTypeServiceCreate()->setScheduleLimit($scheduleLimit); + + return $this; + } + + public function setScheduleLimitAllowance(int $scheduleLimitAllowance): RegistrarInterface + { + $this->_getTypeServiceCreate()->setScheduleLimit($scheduleLimitAllowance); + + return $this; + } + + public function setIsEnabled(bool $isEnabled): RegistrarInterface + { + $this->_getTypeServiceCreate()->setIsEnabled($isEnabled); + + return $this; + } + + public function setAutoCompleteSuccess(bool $autoCompleteSuccess): RegistrarInterface + { + $this->_getTypeServiceCreate()->setAutoCompleteSuccess($autoCompleteSuccess); + + return $this; + } + + public function setAutoDeleteIntervalDuration(string $autoDeleteIntervalDuration): RegistrarInterface + { + $this->_getTypeServiceCreate()->setAutoDeleteIntervalDuration($autoDeleteIntervalDuration); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Type/Registrar.yml b/src/Api/V1/Job/Type/Registrar.yml new file mode 100644 index 00000000..e72e0dc5 --- /dev/null +++ b/src/Api/V1/Job/Type/Registrar.yml @@ -0,0 +1,10 @@ +services: + neighborhoods.kojo.api.v1.job.type.registrar: + class: Neighborhoods\Kojo\Api\V1\Job\Type\Registrar + public: false + shared: false + calls: + - [setTypeServiceCreate, ['@type.service.create']] + api.v1.job.type.registrar: + alias: neighborhoods.kojo.api.v1.job.type.registrar + public: true \ No newline at end of file diff --git a/src/Api/V1/Job/Type/Registrar/AwareTrait.php b/src/Api/V1/Job/Type/Registrar/AwareTrait.php new file mode 100644 index 00000000..62074c44 --- /dev/null +++ b/src/Api/V1/Job/Type/Registrar/AwareTrait.php @@ -0,0 +1,38 @@ +_create(RegistrarInterface::class, $ApiV1JobTypeRegistrar); + + return $this; + } + + protected function _getApiV1JobTypeRegistrar(): RegistrarInterface + { + return $this->_read(RegistrarInterface::class); + } + + protected function _getApiV1JobTypeRegistrarClone(): RegistrarInterface + { + return clone $this->_getApiV1JobTypeRegistrar(); + } + + protected function _hasApiV1JobTypeRegistrar(): bool + { + return $this->_exists(RegistrarInterface::class); + } + + protected function _unsetApiV1JobTypeRegistrar(): self + { + $this->_delete(RegistrarInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Type/Registrar/Factory.php b/src/Api/V1/Job/Type/Registrar/Factory.php new file mode 100644 index 00000000..280d9ba8 --- /dev/null +++ b/src/Api/V1/Job/Type/Registrar/Factory.php @@ -0,0 +1,19 @@ +_getApiV1JobTypeRegistrarClone(); + + return $apiV1JobTypeRegistrar; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Type/Registrar/Factory.yml b/src/Api/V1/Job/Type/Registrar/Factory.yml new file mode 100644 index 00000000..9c8241a6 --- /dev/null +++ b/src/Api/V1/Job/Type/Registrar/Factory.yml @@ -0,0 +1,10 @@ +services: + neighborhoods.kojo.api.v1.job.type.registrar.factory: + class: Neighborhoods\Kojo\Api\V1\Job\Type\Registrar\Factory + public: false + shared: true + calls: + - [setApiV1JobTypeRegistrar, ['@api.v1.job.type.registrar']] + api.v1.job.type.registrar.factory: + alias: neighborhoods.kojo.api.v1.job.type.registrar.factory + public: true \ No newline at end of file diff --git a/src/Api/V1/Job/Type/Registrar/Factory/AwareTrait.php b/src/Api/V1/Job/Type/Registrar/Factory/AwareTrait.php new file mode 100644 index 00000000..c476dd8d --- /dev/null +++ b/src/Api/V1/Job/Type/Registrar/Factory/AwareTrait.php @@ -0,0 +1,38 @@ +_create(FactoryInterface::class, $apiV1JobTypeRegistrarFactory); + + return $this; + } + + protected function _getApiV1JobTypeRegistrarFactory(): FactoryInterface + { + return $this->_read(FactoryInterface::class); + } + + protected function _getApiV1JobTypeRegistrarFactoryClone(): FactoryInterface + { + return clone $this->_getApiV1JobTypeRegistrarFactory(); + } + + protected function _hasApiV1JobTypeRegistrarFactory(): bool + { + return $this->_exists(FactoryInterface::class); + } + + protected function _unsetApiV1JobTypeRegistrarFactory(): self + { + $this->_delete(FactoryInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Type/Registrar/FactoryInterface.php b/src/Api/V1/Job/Type/Registrar/FactoryInterface.php new file mode 100644 index 00000000..25c42c9e --- /dev/null +++ b/src/Api/V1/Job/Type/Registrar/FactoryInterface.php @@ -0,0 +1,11 @@ +_getContainerBuilderFacade()->addFinder($ymlServiceFinder); + + return $this; + } + + public function getNewJobTypeRegistrar(): RegistrarInterface + { + return $this->_getContainerBuilder()->get(self::REGISTRAR_FACTORY_SERVICE_ID)->create(); + } + + protected function _getContainerBuilder(): ContainerBuilder + { + return $this->_getContainerBuilderFacade()->getContainerBuilder(); + } + + protected function _getContainerBuilderFacade(): FacadeInterface + { + if ($this->_containerBuilderFacade === null) { + $this->_containerBuilderFacade = new Facade(); + } + + return $this->_containerBuilderFacade; + } +} \ No newline at end of file diff --git a/src/Api/V1/Job/Type/ServiceInterface.php b/src/Api/V1/Job/Type/ServiceInterface.php new file mode 100644 index 00000000..3d87df59 --- /dev/null +++ b/src/Api/V1/Job/Type/ServiceInterface.php @@ -0,0 +1,9 @@ +_getLogger()->emergency($message, $context); + } + + /** Action must be taken immediately. */ + public function alert($message, array $context = array()) + { + $this->_getLogger()->alert($message, $context); + } + + /** Critical conditions. */ + public function critical($message, array $context = array()) + { + $this->_getLogger()->critical($message, $context); + } + + /** Runtime errors that do not require immediate action but should typically be logged and monitored. */ + public function error($message, array $context = array()) + { + $this->_getLogger()->error($message, $context); + } + + /** Exceptional occurrences that are not errors. */ + public function warning($message, array $context = array()) + { + $this->_getLogger()->warning($message, $context); + } + + /** Normal but significant events. */ + public function notice($message, array $context = array()) + { + $this->_getLogger()->notice($message, $context); + } + + /** Interesting events. */ + public function info($message, array $context = array()) + { + $this->_getLogger()->info($message, $context); + } + + /** Detailed debug information. */ + public function debug($message, array $context = array()) + { + $this->_getLogger()->debug($message, $context); + } + + /** Logs with an arbitrary level. */ + public function log($level, $message, array $context = array()) + { + $this->_getLogger()->log($level, $message, $context); + } +} \ No newline at end of file diff --git a/src/Api/V1/Logger/AwareTrait.php b/src/Api/V1/Logger/AwareTrait.php new file mode 100644 index 00000000..9714ed44 --- /dev/null +++ b/src/Api/V1/Logger/AwareTrait.php @@ -0,0 +1,38 @@ +_create(LoggerInterface::class, $apiV1Logger); + + return $this; + } + + protected function _getApiV1Logger(): LoggerInterface + { + return $this->_read(LoggerInterface::class); + } + + protected function _getApiV1LoggerClone(): LoggerInterface + { + return clone $this->_getApiV1Logger(); + } + + protected function _hasApiV1Logger(): bool + { + return $this->_exists(LoggerInterface::class); + } + + protected function _unsetApiV1Logger(): self + { + $this->_delete(LoggerInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Api/V1/LoggerInterface.php b/src/Api/V1/LoggerInterface.php new file mode 100644 index 00000000..3ea60221 --- /dev/null +++ b/src/Api/V1/LoggerInterface.php @@ -0,0 +1,8 @@ +_create(ServiceInterface::class, $workerJobService); - - return $this; - } - - protected function _getWorkerJobService(): ServiceInterface - { - return $this->_read(ServiceInterface::class); - } - - protected function _hasWorkerJobService(): bool - { - return $this->_exists(ServiceInterface::class); - } - - protected function _unsetWorkerJobService(): self - { - $this->_delete(ServiceInterface::class); - - return $this; - } -} \ No newline at end of file diff --git a/src/Api/V1/Worker/Job/ServiceInterface.php b/src/Api/V1/Worker/Job/ServiceInterface.php deleted file mode 100644 index bea98a1d..00000000 --- a/src/Api/V1/Worker/Job/ServiceInterface.php +++ /dev/null @@ -1,34 +0,0 @@ -save(); break; default: - throw new \UnexpectedValueException('Unexpected value "' . $this->_read(self::PROP_REQUEST) . '"'); + throw new \UnexpectedValueException('Unexpected value[' . $this->_read(self::PROP_REQUEST) . '].'); } $this->_create(self::PROP_REQUEST_APPLIED, true); } @@ -105,8 +109,13 @@ public function isRequestApplied(): bool return $this->_exists(self::PROP_REQUEST_APPLIED); } - public function getNewJobServiceCreate(): CreateInterface + public function getLogger(): LoggerInterface { - return $this->_getServiceCreateFactory()->create(); + return $this->_getApiV1Logger(); + } + + public function getNewJobScheduler(): SchedulerInterface + { + return $this->_getApiV1JobSchedulerFactory()->create(); } } \ No newline at end of file diff --git a/src/Worker/Job/Service.yml b/src/Api/V1/Worker/Service.yml similarity index 60% rename from src/Worker/Job/Service.yml rename to src/Api/V1/Worker/Service.yml index ab19db67..c4fe6e75 100644 --- a/src/Worker/Job/Service.yml +++ b/src/Api/V1/Worker/Service.yml @@ -1,12 +1,12 @@ services: - neighborhoods.kojo.worker.job.service: - class: Neighborhoods\Kojo\Worker\Job\Service + neighborhoods.kojo.api.v1.worker.service: + class: Neighborhoods\Kojo\Api\V1\Worker\Service shared: false calls: - - [setServiceCreateFactory, ['@service.create.factory']] - [setServiceUpdateCompleteFailedFactory, ['@service.update.complete.failed.factory']] - [setServiceUpdateCompleteSuccessFactory, ['@service.update.complete.success.factory']] - [setServiceUpdateHoldFactory, ['@service.update.hold.factory']] - [setServiceUpdateRetryFactory, ['@service.update.retry.factory']] - worker.job.service: - alias: neighborhoods.kojo.worker.job.service \ No newline at end of file + - [setApiV1JobSchedulerFactory, ['@api.v1.job.scheduler.factory']] + api.v1.worker.service: + alias: neighborhoods.kojo.api.v1.worker.service \ No newline at end of file diff --git a/src/Api/V1/Worker/Service/AwareTrait.php b/src/Api/V1/Worker/Service/AwareTrait.php new file mode 100644 index 00000000..d20bdd8a --- /dev/null +++ b/src/Api/V1/Worker/Service/AwareTrait.php @@ -0,0 +1,33 @@ +_create(ServiceInterface::class, $workerService); + + return $this; + } + + protected function _getApiV1WorkerService(): ServiceInterface + { + return $this->_read(ServiceInterface::class); + } + + protected function _hasApiV1WorkerService(): bool + { + return $this->_exists(ServiceInterface::class); + } + + protected function _unsetApiV1WorkerService(): self + { + $this->_delete(ServiceInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Worker/Job/ServiceInterface.php b/src/Api/V1/Worker/ServiceInterface.php similarity index 77% rename from src/Worker/Job/ServiceInterface.php rename to src/Api/V1/Worker/ServiceInterface.php index 47e749be..7bb1a7dd 100644 --- a/src/Worker/Job/ServiceInterface.php +++ b/src/Api/V1/Worker/ServiceInterface.php @@ -1,10 +1,8 @@ setName('db:setup:install'); + $this->setName(self::COMMAND_NAME); $this->setDescription('Installs Kōjō to a persistent storage engine.'); $this->setHelp($this->_getHelp()); @@ -25,7 +26,7 @@ public function _execute(): CommandAbstract { $this->_getBootstrap()->instantiate(); $this->_getDbSetup()->install(); - $this->_getOutput()->writeln('Kōjō has been successfully installed.'); + $this->_getOutput()->writeln('Kōjō has been successfully installed!'); return $this; } diff --git a/src/Console/Command/Db/TearDown/Uninstall.php b/src/Console/Command/Db/TearDown/Uninstall.php index aaa2f9aa..3d347cee 100644 --- a/src/Console/Command/Db/TearDown/Uninstall.php +++ b/src/Console/Command/Db/TearDown/Uninstall.php @@ -6,15 +6,21 @@ use Neighborhoods\Kojo\Console\CommandAbstract; use Neighborhoods\Kojo\Worker\Bootstrap; use Neighborhoods\Kojo\Db\TearDown; +use Symfony\Component\Console\Helper\QuestionHelper; +use Symfony\Component\Console\Question\Question; class Uninstall extends CommandAbstract { use Bootstrap\AwareTrait; use TearDown\AwareTrait; + public const COMMAND_NAME = 'db:tear_down:uninstall'; + public const ANSWER_DELETE_CONFIRMED_BY_USER = 'delete'; + public const ANSWER_DELETE_DECLINED_BY_USER = 'no'; + protected $_question; protected function _configure(): CommandAbstract { - $this->setName('db:teardown:uninstall'); + $this->setName(self::COMMAND_NAME); $this->setDescription('Uninstalls Kōjō and ALL DATA from the persistent storage engine.'); $this->setHelp($this->_getHelp()); @@ -23,17 +29,70 @@ protected function _configure(): CommandAbstract public function _execute(): CommandAbstract { - $this->_getBootstrap()->instantiate(); - $this->_getDbTearDown()->uninstall(); - $this->_getOutput()->writeln('Kōjō has been successfully uninstalled.'); + if ($this->_isUninstallConfirmedByUser()) { + $this->_getBootstrap()->instantiate(); + $this->_getDbTearDown()->uninstall(); + $this->_getOutput()->writeln('Kōjō has been successfully uninstalled.'); + }else { + $this->_getOutput()->writeln('Kōjō was not uninstalled.'); + } return $this; } + protected function _isUninstallConfirmedByUser(): bool + { + return $this->_getQuestionHelper()->ask($this->_getInput(), $this->_getOutput(), $this->_getQuestion()); + } + + protected function _getQuestionHelper(): QuestionHelper + { + return $this->getHelper('question'); + } + + protected function _getQuestion(): Question + { + if ($this->_question === null) { + $question = new Question($this->_getQuestionMessage(), false); + $question->setValidator($this->_getValidator()); + $this->_question = $question; + } + + return $this->_question; + } + + protected function _getValidator(): callable + { + $validator = function (string $answer): bool{ + $confirmedByUser = Uninstall::ANSWER_DELETE_CONFIRMED_BY_USER; + if (!($confirmedByUser === $answer || Uninstall::ANSWER_DELETE_DECLINED_BY_USER === $answer)) { + throw new \RuntimeException('Please type either "delete" or "no" to proceed.'); + } + + return ($answer === $confirmedByUser); + }; + + return $validator; + } + + protected function _getQuestionMessage(): string + { + return <<<'EOD' + + !!! WARNING !!! + + THIS ACTION WILL PERMANENTLY DELETE ALL OF YOUR KŌJŌ DATA!!! + + THIS ACTION CANNOT BE UNDONE! + +Do you want to permanently delete ALL of your Kōjō data?(delete | no) +EOD; + } + protected function _getHelp(): string { return <<<'EOD' -WARNING: THIS WILL DELETE ALL JOB DATA IN PERSISTENT STORAGE. +WARNING!!! THIS WILL DELETE ALL KŌJŌ DATA IN PERSISTENT STORAGE! This command UNINSTALLS a Kōjō cluster from a persistent storage engine. Currently only \PDO compatible storage engines are supported. diff --git a/src/Console/Command/Process/Pool/Server/Start.php b/src/Console/Command/Process/Pool/Server/Start.php index ce4f4c16..fed141c3 100644 --- a/src/Console/Command/Process/Pool/Server/Start.php +++ b/src/Console/Command/Process/Pool/Server/Start.php @@ -11,13 +11,13 @@ class Start extends CommandAbstract const OPT_SERVICES_YML_DIRECTORY_PATH = 'services-yml-directory-path'; const OPT_YSDP = 'ysdp'; const OPT_RUN_SERVER = '--run-server'; - const NAME = 'process:pool:server:start'; - const NAME_ALIASES = ['gō-gō']; + const COMMAND_NAME = 'process:pool:server:start'; + const COMMAND_NAME_ALIASES = ['gō-gō']; protected function _configure(): CommandAbstract { - $this->setName(self::NAME); - $this->setAliases(self::NAME_ALIASES); + $this->setName(self::COMMAND_NAME); + $this->setAliases(self::COMMAND_NAME_ALIASES); $this->setDescription('Starts a new process pool server.'); $this->setHelp($this->_getHelp()); $this->addOption( diff --git a/src/Console/CommandAbstract.php b/src/Console/CommandAbstract.php index e56f5722..707161e2 100644 --- a/src/Console/CommandAbstract.php +++ b/src/Console/CommandAbstract.php @@ -19,7 +19,7 @@ abstract class CommandAbstract extends Command '| |', '| 工場 |', '| |', - '| A distributed task manager |', + '| a distributed task manager |', '+------------------------------+', ]; diff --git a/src/Data/AutoSchedule/Sqs.php b/src/Data/AutoSchedule/Sqs.php deleted file mode 100644 index fd80cde2..00000000 --- a/src/Data/AutoSchedule/Sqs.php +++ /dev/null @@ -1,44 +0,0 @@ -setTableName(SqsInterface::TABLE_NAME); - $this->setIdPropertyName(SqsInterface::FIELD_NAME_ID); - - return $this; - } - - public function setSqsQueueName(string $sqsQueueName): SqsInterface - { - $this->_create(self::FIELD_NAME_SQS_QUEUE_NAME, $sqsQueueName); - - return $this; - } - - public function getSqsQueueName(): string - { - return $this->_read(self::FIELD_NAME_SQS_QUEUE_NAME); - } - - public function setJobTypeCode(string $jobTypeCode): SqsInterface - { - $this->_create(self::FIELD_NAME_JOB_TYPE_CODE, $jobTypeCode); - - return $this; - } - - public function getJobTypeCode(): string - { - return $this->_read(self::FIELD_NAME_JOB_TYPE_CODE); - } -} \ No newline at end of file diff --git a/src/Data/AutoSchedule/Sqs/AwareTrait.php b/src/Data/AutoSchedule/Sqs/AwareTrait.php deleted file mode 100644 index 0d63e30a..00000000 --- a/src/Data/AutoSchedule/Sqs/AwareTrait.php +++ /dev/null @@ -1,38 +0,0 @@ -_create(SqsInterface::class, $autoScheduleSqs); - - return $this; - } - - protected function _getAutoScheduleSqs(): SqsInterface - { - return $this->_read(SqsInterface::class); - } - - protected function _getAutoScheduleSqsClone(): SqsInterface - { - return clone $this->_getAutoScheduleSqs(); - } - - protected function _hasAutoScheduleSqs(): bool - { - return $this->_exists(SqsInterface::class); - } - - protected function _unsetAutoScheduleSqs() - { - $this->_delete(SqsInterface::class); - - return $this; - } -} \ No newline at end of file diff --git a/src/Data/AutoSchedule/SqsInterface.php b/src/Data/AutoSchedule/SqsInterface.php deleted file mode 100644 index 7654712f..00000000 --- a/src/Data/AutoSchedule/SqsInterface.php +++ /dev/null @@ -1,24 +0,0 @@ -_createPersistentProperty(self::FIELD_NAME_PROCESS_TYPE_CODE, $processTypeCode); + $this->_createOrUpdatePersistentProperty(JobInterface::FIELD_NAME_MOST_RECENT_HOST_NAME, $mostRecentHostName); return $this; } - public function getProcessTypeCode(): string + public function getMostRecentHostName(): string { - return $this->_readPersistentProperty(self::FIELD_NAME_PROCESS_TYPE_CODE); + return $this->_readPersistentProperty(JobInterface::FIELD_NAME_MOST_RECENT_HOST_NAME); + } + + public function setMostRecentProcessId(int $mostRecentProcessId): JobInterface + { + $this->_createOrUpdatePersistentProperty(JobInterface::FIELD_NAME_MOST_RECENT_PROCESS_ID, $mostRecentProcessId); + + return $this; + } + + public function getMostRecentProcessId(): int + { + return (int)$this->_readPersistentProperty(JobInterface::FIELD_NAME_MOST_RECENT_PROCESS_ID); } } \ No newline at end of file diff --git a/src/Data/Job/Collection/ScheduleLimit.php b/src/Data/Job/Collection/ScheduleLimit.php index bde20182..abdeee75 100644 --- a/src/Data/Job/Collection/ScheduleLimit.php +++ b/src/Data/Job/Collection/ScheduleLimit.php @@ -18,7 +18,14 @@ class ScheduleLimit extends CollectionAbstract implements ScheduleLimitInterface public function getNumberOfCurrentlyScheduledJobs(): int { - return (int)$this->_getRecords()[self::ALIAS_NUMBER_OF_SCHEDULED_JOBS]; + return $this->_getRecords()[self::ALIAS_NUMBER_OF_SCHEDULED_JOBS]; + } + + public function decrementNumberOfCurrentlyScheduledJobs(): ScheduleLimitInterface + { + --$this->_getRecords()[self::ALIAS_NUMBER_OF_SCHEDULED_JOBS]; + + return $this; } protected function &_getRecords(): array @@ -38,6 +45,8 @@ protected function &_getRecords(): array }else { $this->_create(self::PROP_RECORDS, $records); } + $numberOfScheduledJobs = (int)$this->_read(self::PROP_RECORDS)[self::ALIAS_NUMBER_OF_SCHEDULED_JOBS]; + $this->_read(self::PROP_RECORDS)[self::ALIAS_NUMBER_OF_SCHEDULED_JOBS] = $numberOfScheduledJobs; } return $this->_read(self::PROP_RECORDS); diff --git a/src/Data/Job/Collection/ScheduleLimitInterface.php b/src/Data/Job/Collection/ScheduleLimitInterface.php index fa914bd5..06a4e592 100644 --- a/src/Data/Job/Collection/ScheduleLimitInterface.php +++ b/src/Data/Job/Collection/ScheduleLimitInterface.php @@ -11,4 +11,6 @@ interface ScheduleLimitInterface extends CollectionInterface public function setJobType(TypeInterface $job); public function getNumberOfCurrentlyScheduledJobs(): int; + + public function decrementNumberOfCurrentlyScheduledJobs(): ScheduleLimitInterface; } \ No newline at end of file diff --git a/src/Data/Job/Collection/Selector.php b/src/Data/Job/Collection/Selector.php index 0b3bf37b..9acab699 100644 --- a/src/Data/Job/Collection/Selector.php +++ b/src/Data/Job/Collection/Selector.php @@ -66,12 +66,10 @@ protected function _prepareCollection(): Db\Model\CollectionAbstract JobInterface::FIELD_NAME_ID, JobInterface::FIELD_NAME_TYPE_CODE, JobInterface::FIELD_NAME_CAN_WORK_IN_PARALLEL, - JobInterface::FIELD_NAME_PROCESS_TYPE_CODE, ] ); $select->order( [ - JobInterface::FIELD_NAME_PROCESS_TYPE_CODE . ' DESC', JobInterface::FIELD_NAME_PRIORITY . ' DESC', ] ); diff --git a/src/Data/Job/Type.php b/src/Data/Job/Type.php index cb7c6767..df088dbb 100644 --- a/src/Data/Job/Type.php +++ b/src/Data/Job/Type.php @@ -116,6 +116,21 @@ public function getScheduleLimit(): int return (int)$this->_readPersistentProperty(TypeInterface::FIELD_NAME_SCHEDULE_LIMIT); } + public function setScheduleLimitAllowance(int $scheduleLimitAllowance): TypeInterface + { + if ($scheduleLimitAllowance < 0) { + throw new \InvalidArgumentException('Schedule limit allowance is less than zero.'); + }; + $this->_createPersistentProperty(TypeInterface::FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE, $scheduleLimitAllowance); + + return $this; + } + + public function getScheduleLimitAllowance(): int + { + return (int)$this->_readPersistentProperty(TypeInterface::FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE); + } + public function setIsEnabled(bool $isEnabled): TypeInterface { $this->_createPersistentProperty(TypeInterface::FIELD_NAME_IS_ENABLED, $isEnabled); @@ -155,16 +170,4 @@ public function getAutoDeleteIntervalDuration(): string { return $this->_readPersistentProperty(TypeInterface::FIELD_NAME_AUTO_DELETE_INTERVAL_DURATION); } - - public function setProcessTypeCode(string $processTypeCode): TypeInterface - { - $this->_createPersistentProperty(self::FIELD_NAME_PROCESS_TYPE_CODE, $processTypeCode); - - return $this; - } - - public function getProcessTypeCode(): string - { - return $this->_readPersistentProperty(self::FIELD_NAME_PROCESS_TYPE_CODE); - } } \ No newline at end of file diff --git a/src/Data/Job/TypeInterface.php b/src/Data/Job/TypeInterface.php index 73ca5c73..154a6f2e 100644 --- a/src/Data/Job/TypeInterface.php +++ b/src/Data/Job/TypeInterface.php @@ -7,22 +7,22 @@ interface TypeInterface extends ModelInterface { - const TABLE_NAME = 'kojo_job_type'; - const FIELD_NAME_ID = 'kojo_job_type_id'; - const FIELD_NAME_TYPE_CODE = 'type_code'; - const FIELD_NAME_NAME = 'name'; - const FIELD_NAME_WORKER_URI = 'worker_uri'; - const FIELD_NAME_WORKER_METHOD = 'worker_method'; - const FIELD_NAME_CAN_WORK_IN_PARALLEL = 'can_work_in_parallel'; - const FIELD_NAME_DEFAULT_IMPORTANCE = 'default_importance'; - const FIELD_NAME_CRON_EXPRESSION = 'cron_expression'; - const FIELD_NAME_SCHEDULE_LIMIT = 'schedule_limit'; - const FIELD_NAME_IS_ENABLED = 'is_enabled'; - const FIELD_NAME_AUTO_COMPLETE_SUCCESS = 'auto_complete_success'; - const FIELD_NAME_AUTO_DELETE_INTERVAL_DURATION = 'auto_delete_interval_duration'; - const INDEX_NAME_SCHEDULER_COVERING = 'SCHEDULER_COVERING'; - const INDEX_NAME_COVERING = 'COVERING'; - const FIELD_NAME_PROCESS_TYPE_CODE = 'process_type_code'; + public const TABLE_NAME = 'kojo_job_type'; + public const FIELD_NAME_ID = 'kojo_job_type_id'; + public const FIELD_NAME_TYPE_CODE = 'type_code'; + public const FIELD_NAME_NAME = 'name'; + public const FIELD_NAME_WORKER_URI = 'worker_uri'; + public const FIELD_NAME_WORKER_METHOD = 'worker_method'; + public const FIELD_NAME_CAN_WORK_IN_PARALLEL = 'can_work_in_parallel'; + public const FIELD_NAME_DEFAULT_IMPORTANCE = 'default_importance'; + public const FIELD_NAME_CRON_EXPRESSION = 'cron_expression'; + public const FIELD_NAME_SCHEDULE_LIMIT = 'schedule_limit'; + public const FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE = 'schedule_limit_allowance'; + public const FIELD_NAME_IS_ENABLED = 'is_enabled'; + public const FIELD_NAME_AUTO_COMPLETE_SUCCESS = 'auto_complete_success'; + public const FIELD_NAME_AUTO_DELETE_INTERVAL_DURATION = 'auto_delete_interval_duration'; + public const INDEX_NAME_SCHEDULER_COVERING = 'SCHEDULER_COVERING'; + public const INDEX_NAME_COVERING = 'COVERING'; public function setCode(string $code): TypeInterface; @@ -68,7 +68,7 @@ public function setAutoDeleteIntervalDuration(string $autoDeleteIntervalDuration public function getAutoDeleteIntervalDuration(): string; - public function setProcessTypeCode(string $processTypeCode): TypeInterface; + public function setScheduleLimitAllowance(int $scheduleLimitAllowance): TypeInterface; - public function getProcessTypeCode(): string; + public function getScheduleLimitAllowance(): int; } \ No newline at end of file diff --git a/src/Data/JobInterface.php b/src/Data/JobInterface.php index e6702aaf..97b791e8 100644 --- a/src/Data/JobInterface.php +++ b/src/Data/JobInterface.php @@ -7,36 +7,37 @@ interface JobInterface extends ModelInterface { - const TABLE_NAME = 'kojo_job'; - const FIELD_NAME_ID = 'kojo_job_id'; - const FIELD_NAME_TYPE_CODE = 'type_code'; - const FIELD_NAME_NAME = 'name'; - const FIELD_NAME_PRIORITY = 'priority'; - const FIELD_NAME_IMPORTANCE = 'importance'; - const FIELD_NAME_STATUS_ID = 'status_id'; - const FIELD_NAME_WORK_AT_DATE_TIME = 'work_at_date_time'; - const FIELD_NAME_NEXT_STATE_REQUEST = 'next_state_request'; - const FIELD_NAME_ASSIGNED_STATE = 'assigned_state'; - const FIELD_NAME_PREVIOUS_STATE = 'previous_state'; - const FIELD_NAME_WORKER_URI = 'worker_uri'; - const FIELD_NAME_WORKER_METHOD = 'worker_method'; - const FIELD_NAME_CAN_WORK_IN_PARALLEL = 'can_work_in_parallel'; - const FIELD_NAME_LAST_TRANSITION_DATE_TIME = 'last_transition_date_time'; - const FIELD_NAME_LAST_TRANSITION_MICRO_TIME = 'last_transition_micro_time'; - const FIELD_NAME_TIMES_WORKED = 'times_worked'; - const FIELD_NAME_TIMES_RETRIED = 'times_retried'; - const FIELD_NAME_TIMES_HELD = 'times_held'; - const FIELD_NAME_TIMES_CRASHED = 'times_crashed'; - const FIELD_NAME_TIMES_PANICKED = 'times_panicked'; - const FIELD_NAME_CREATED_AT_DATE_TIME = 'created_at_date_time'; - const FIELD_NAME_COMPLETED_AT_DATE_TIME = 'completed_at_date_time'; - const FIELD_NAME_DELETE_AFTER_DATE_TIME = 'delete_after_date_time'; - const FOREIGN_KEY_NAME_JOB_TYPE_CODE = 'JOB_TYPE_CODE'; - const INDEX_NAME_SCHEDULER = 'SCHEDULER'; - const INDEX_NAME_PENDING = 'PENDING'; - const INDEX_NAME_CRASHED_AND_SELECTION_AND_LIMIT_CHECK = 'CRASHED_AND_SELECTION_AND_LIMIT_CHECK'; - const INDEX_NAME_AUTO_DELETE = 'DELETE_AFTER'; - const FIELD_NAME_PROCESS_TYPE_CODE = 'process_type_code'; + public const TABLE_NAME = 'kojo_job'; + public const FIELD_NAME_ID = 'kojo_job_id'; + public const FIELD_NAME_TYPE_CODE = 'type_code'; + public const FIELD_NAME_NAME = 'name'; + public const FIELD_NAME_PRIORITY = 'priority'; + public const FIELD_NAME_IMPORTANCE = 'importance'; + public const FIELD_NAME_STATUS_ID = 'status_id'; + public const FIELD_NAME_WORK_AT_DATE_TIME = 'work_at_date_time'; + public const FIELD_NAME_NEXT_STATE_REQUEST = 'next_state_request'; + public const FIELD_NAME_ASSIGNED_STATE = 'assigned_state'; + public const FIELD_NAME_PREVIOUS_STATE = 'previous_state'; + public const FIELD_NAME_WORKER_URI = 'worker_uri'; + public const FIELD_NAME_WORKER_METHOD = 'worker_method'; + public const FIELD_NAME_CAN_WORK_IN_PARALLEL = 'can_work_in_parallel'; + public const FIELD_NAME_LAST_TRANSITION_DATE_TIME = 'last_transition_date_time'; + public const FIELD_NAME_LAST_TRANSITION_MICRO_TIME = 'last_transition_micro_time'; + public const FIELD_NAME_TIMES_WORKED = 'times_worked'; + public const FIELD_NAME_TIMES_RETRIED = 'times_retried'; + public const FIELD_NAME_TIMES_HELD = 'times_held'; + public const FIELD_NAME_TIMES_CRASHED = 'times_crashed'; + public const FIELD_NAME_TIMES_PANICKED = 'times_panicked'; + public const FIELD_NAME_CREATED_AT_DATE_TIME = 'created_at_date_time'; + public const FIELD_NAME_COMPLETED_AT_DATE_TIME = 'completed_at_date_time'; + public const FIELD_NAME_DELETE_AFTER_DATE_TIME = 'delete_after_date_time'; + public const FIELD_NAME_MOST_RECENT_HOST_NAME = 'most_recent_host_name'; + public const FIELD_NAME_MOST_RECENT_PROCESS_ID = 'most_recent_process_id'; + public const FOREIGN_KEY_NAME_JOB_TYPE_CODE = 'JOB_TYPE_CODE'; + public const INDEX_NAME_SCHEDULER = 'SCHEDULER'; + public const INDEX_NAME_PENDING = 'PENDING'; + public const INDEX_NAME_CRASHED_AND_SELECTION_AND_LIMIT_CHECK = 'CRASHED_AND_SELECTION_AND_LIMIT_CHECK'; + public const INDEX_NAME_AUTO_DELETE = 'DELETE_AFTER'; public function setTypeCode(string $typeCode): JobInterface; @@ -126,7 +127,11 @@ public function setDeleteAfterDateTime(\DateTime $deleteAfterDateTime): JobInter public function getDeleteAfterDateTime(): \DateTime; - public function setProcessTypeCode(string $processTypeCode): JobInterface; + public function setMostRecentHostName(string $mostRecentHostName): JobInterface; - public function getProcessTypeCode(): string; + public function getMostRecentHostName(): string; + + public function setMostRecentProcessId(int $mostRecentProcessId): JobInterface; + + public function getMostRecentProcessId(): int; } \ No newline at end of file diff --git a/src/Db/Setup.yml b/src/Db/Setup.yml index 38159cd1..8e47c982 100644 --- a/src/Db/Setup.yml +++ b/src/Db/Setup.yml @@ -9,7 +9,6 @@ services: - [addVersion, ["@db.setup.schema.version.3_0_0"]] - [addVersion, ["@db.setup.schema.version.4_0_0"]] - [addVersion, ["@db.setup.schema.version.5_0_0"]] - - [addVersion, ["@db.setup.schema.version_6_0_0"]] db.setup: public: false alias: neighborhoods.kojo.db.setup \ No newline at end of file diff --git a/src/Db/Setup/Schema/Version_4_0_0.php b/src/Db/Setup/Schema/Version_4_0_0.php index 2d83881a..ccdc9195 100644 --- a/src/Db/Setup/Schema/Version_4_0_0.php +++ b/src/Db/Setup/Schema/Version_4_0_0.php @@ -78,6 +78,13 @@ public function assembleSchemaChanges(): VersionInterface 'comment' => 'COMMENT', 'unsigned' => true, ])); + $createTable->addColumn( + new Integer( + Type::FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE, true, null, + [ + 'comment' => 'COMMENT', + 'unsigned' => true, + ])); $createTable->addColumn( new Boolean( Type::FIELD_NAME_IS_ENABLED, false, null, @@ -97,12 +104,6 @@ public function assembleSchemaChanges(): VersionInterface 'comment' => 'A ISO 8601 interval duration that describes duration of time past a Job\'s' . ' completed_at_date_time that a Job record of this Job Type should be deleted from storage.', ])); - $createTable->addColumn( - new Varchar( - Type::FIELD_NAME_PROCESS_TYPE_CODE, 255, false, null, - [ - 'comment' => 'The process type code used to run this job type.', - ])); $createTable->addConstraint(new PrimaryKey(Type::FIELD_NAME_ID, Type::FIELD_NAME_ID)); $createTable->addConstraint(new UniqueKey(Type::FIELD_NAME_TYPE_CODE, Type::FIELD_NAME_TYPE_CODE)); $createTable->addConstraint( @@ -113,6 +114,7 @@ public function assembleSchemaChanges(): VersionInterface Type::FIELD_NAME_TYPE_CODE, Type::FIELD_NAME_DEFAULT_IMPORTANCE, Type::FIELD_NAME_SCHEDULE_LIMIT, + Type::FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE, ], Type::INDEX_NAME_SCHEDULER_COVERING ) @@ -128,6 +130,7 @@ public function assembleSchemaChanges(): VersionInterface Type::FIELD_NAME_CAN_WORK_IN_PARALLEL, Type::FIELD_NAME_DEFAULT_IMPORTANCE, Type::FIELD_NAME_SCHEDULE_LIMIT, + Type::FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE, Type::FIELD_NAME_AUTO_COMPLETE_SUCCESS, Type::FIELD_NAME_AUTO_DELETE_INTERVAL_DURATION, ], diff --git a/src/Db/Setup/Schema/Version_5_0_0.php b/src/Db/Setup/Schema/Version_5_0_0.php index 6f080887..e7170eee 100644 --- a/src/Db/Setup/Schema/Version_5_0_0.php +++ b/src/Db/Setup/Schema/Version_5_0_0.php @@ -173,9 +173,16 @@ public function assembleSchemaChanges(): VersionInterface ])); $createTable->addColumn( new Varchar( - JobInterface::FIELD_NAME_PROCESS_TYPE_CODE, 255, false, null, + JobInterface::FIELD_NAME_MOST_RECENT_HOST_NAME, 255, false, null, [ - 'comment' => 'The process type code used to run this job.', + 'comment' => 'COMMENT', + ])); + $createTable->addColumn( + new Integer( + JobInterface::FIELD_NAME_MOST_RECENT_PROCESS_ID, false, null, + [ + 'comment' => 'COMMENT', + 'unsigned' => true, ])); $createTable->addConstraint(new PrimaryKey(JobInterface::FIELD_NAME_ID)); $createTable->addConstraint( @@ -184,7 +191,6 @@ public function assembleSchemaChanges(): VersionInterface JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, JobInterface::FIELD_NAME_ASSIGNED_STATE, JobInterface::FIELD_NAME_WORK_AT_DATE_TIME, - JobInterface::FIELD_NAME_PROCESS_TYPE_CODE, JobInterface::FIELD_NAME_PRIORITY, JobInterface::FIELD_NAME_TYPE_CODE, JobInterface::FIELD_NAME_CAN_WORK_IN_PARALLEL, diff --git a/src/Db/Setup/Schema/Version_6_0_0.php b/src/Db/Setup/Schema/Version_6_0_0.php deleted file mode 100644 index a299b5a4..00000000 --- a/src/Db/Setup/Schema/Version_6_0_0.php +++ /dev/null @@ -1,60 +0,0 @@ -addColumn( - new BigInteger( - SqsInterface::FIELD_NAME_ID, false, null, - [ - 'comment' => 'The unique ID of this sqs auto-schedule record.', - 'identity' => true, - 'unsigned' => true, - ])); - $createTable->addColumn( - new Varchar( - SqsInterface::FIELD_NAME_JOB_TYPE_CODE, 255, false, null, - [ - 'comment' => 'The job type code to which this auto-schedule record relates.', - ])); - $createTable->addColumn( - new Varchar( - SqsInterface::FIELD_NAME_SQS_QUEUE_NAME, 255, false, null, - [ - 'comment' => 'The SQS queue name to which this auto-schedule record relates.', - ])); - $createTable->addConstraint( - new PrimaryKey( - SqsInterface::FIELD_NAME_ID, - SqsInterface::FIELD_NAME_ID - ) - ); - $createTable->addConstraint( - new Index( - [ - SqsInterface::FIELD_NAME_JOB_TYPE_CODE, - SqsInterface::FIELD_NAME_SQS_QUEUE_NAME, - ], - SqsInterface::INDEX_NAME_COVERING - ) - ); - - $this->_setSchemaChanges($createTable); - - return $this; - } -} \ No newline at end of file diff --git a/src/Db/Setup/Schema/Version_6_0_0.yml b/src/Db/Setup/Schema/Version_6_0_0.yml deleted file mode 100644 index 7674abe7..00000000 --- a/src/Db/Setup/Schema/Version_6_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - neighborhoods.kojo.db.setup.schema.version_6_0_0: - class: Neighborhoods\Kojo\Db\Setup\Schema\Version_6_0_0 - calls: - - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] - db.setup.schema.version_6_0_0: - alias: neighborhoods.kojo.db.setup.schema.version_6_0_0 \ No newline at end of file diff --git a/src/Db/TearDown.yml b/src/Db/TearDown.yml index dd6b8aa3..97dd17c8 100644 --- a/src/Db/TearDown.yml +++ b/src/Db/TearDown.yml @@ -3,7 +3,6 @@ services: public: false class: Neighborhoods\Kojo\Db\TearDown calls: - - [addVersion, ["@db.tear_down.schema.version_6_0_0"]] - [addVersion, ["@db.tear_down.schema.version.5_0_0"]] - [addVersion, ["@db.tear_down.schema.version.4_0_0"]] - [addVersion, ["@db.tear_down.schema.version.3_0_0"]] diff --git a/src/Db/TearDown/Schema/Version_6_0_0.php b/src/Db/TearDown/Schema/Version_6_0_0.php deleted file mode 100644 index 2057c7c6..00000000 --- a/src/Db/TearDown/Schema/Version_6_0_0.php +++ /dev/null @@ -1,20 +0,0 @@ -_setSchemaChanges($dropTable); - - return $this; - } -} \ No newline at end of file diff --git a/src/Db/TearDown/Schema/Version_6_0_0.yml b/src/Db/TearDown/Schema/Version_6_0_0.yml deleted file mode 100644 index 7c27a7c0..00000000 --- a/src/Db/TearDown/Schema/Version_6_0_0.yml +++ /dev/null @@ -1,7 +0,0 @@ -services: - neighborhoods.kojo.db.tear_down.schema.version_6_0_0: - class: Neighborhoods\Kojo\Db\TearDown\Schema\Version_6_0_0 - calls: - - [setDbConnectionContainerRepository, ["@db.connection.container.repository"]] - db.tear_down.schema.version_6_0_0: - alias: neighborhoods.kojo.db.tear_down.schema.version_6_0_0 \ No newline at end of file diff --git a/src/Exception/ExceptionTrait.php b/src/Exception/ExceptionTrait.php deleted file mode 100644 index ea137905..00000000 --- a/src/Exception/ExceptionTrait.php +++ /dev/null @@ -1,92 +0,0 @@ -_addMessage($code); - } - - return $this; - } - - protected function _getPossibleMessages() - { - return $this->_possibleMessages; - } - - public function setCode($code) - { - $this->code = $code; - $this->message = ''; - $this->_addMessage($code); - - return $this; - } - - public function addMessage($additionalMessage) - { - $this->_pushMessage($additionalMessage); - - return $this; - } - - public function getPrettyPrintMessages() - { - $prettyPrintMessages = ""; - $messages = json_decode($this->getMessage()); - foreach ($messages as $message) { - $prettyPrintMessages .= $message . "\n"; - } - - return $prettyPrintMessages; - } - - protected function _getMessages() - { - $possibleMessages = $this->_getPossibleMessages(); - - return $possibleMessages; - } - - protected function _addMessage($code) - { - $messages = $this->_getMessages(); - if (isset($messages[$code])) { - $message = $messages[$code]; - }else { - $message = $messages[$code]; - } - - $this->_pushMessage($message); - - return $this; - } - - protected function _pushMessage($message) - { - if ($this->message === "") { - $messages = array(); - }else { - $messages = json_decode($this->message); - } - - $messages[] = $message; - $this->message = json_encode($messages); - - return $this; - } - - protected function _addPossibleMessage($code, $message) - { - $this->_possibleMessages[$code] = $message; - - return $this; - } -} \ No newline at end of file diff --git a/src/Exception/Runtime/Exception.php b/src/Exception/Runtime/Exception.php index 7b391ff5..4d5139ed 100644 --- a/src/Exception/Runtime/Exception.php +++ b/src/Exception/Runtime/Exception.php @@ -3,13 +3,9 @@ namespace Neighborhoods\Kojo\Exception\Runtime; -use Neighborhoods\Kojo\Exception\ExceptionTrait; - -class Exception extends \RuntimeException +class Exception extends \RuntimeException implements ExceptionInterface { - const CODE_PREFIX = self::class; - const CODE_ANONYMOUS = self::CODE_PREFIX . 'anonymous'; - use ExceptionTrait; + protected $_possibleMessages = []; public function __construct($message = null, $code = 0, \Throwable $previous = null) { @@ -22,4 +18,87 @@ public function __construct($message = null, $code = 0, \Throwable $previous = n return $this; } + + protected function _addPossibleMessage($code, $message) + { + $this->_possibleMessages[$code] = $message; + + return $this; + } + + protected function _init($message, $code) + { + if ($message === null) { + $this->_addMessage($code); + } + + return $this; + } + + public function setCode($code) + { + $this->code = $code; + $this->message = ''; + $this->_addMessage($code); + + return $this; + } + + protected function _addMessage($code) + { + $messages = $this->_getMessages(); + if (isset($messages[$code])) { + $message = $messages[$code]; + }else { + $message = $messages[$code]; + } + + $this->_pushMessage($message); + + return $this; + } + + protected function _getMessages() + { + $possibleMessages = $this->_getPossibleMessages(); + + return $possibleMessages; + } + + protected function _getPossibleMessages() + { + return $this->_possibleMessages; + } + + protected function _pushMessage($message) + { + if ($this->message === "") { + $messages = array(); + }else { + $messages = json_decode($this->message); + } + + $messages[] = $message; + $this->message = json_encode($messages); + + return $this; + } + + public function addMessage($additionalMessage) + { + $this->_pushMessage($additionalMessage); + + return $this; + } + + public function getPrettyPrintMessages() + { + $prettyPrintMessages = ""; + $messages = json_decode($this->getMessage()); + foreach ($messages as $message) { + $prettyPrintMessages .= $message . "\n"; + } + + return $prettyPrintMessages; + } } \ No newline at end of file diff --git a/src/Exception/Runtime/ExceptionInterface.php b/src/Exception/Runtime/ExceptionInterface.php new file mode 100644 index 00000000..b2cea9a6 --- /dev/null +++ b/src/Exception/Runtime/ExceptionInterface.php @@ -0,0 +1,16 @@ +setJob($this->_getSelector()->getWorkableJob()); $this->_getLocator()->setJob($this->_getJob()); - if (is_callable($this->_getLocator()->getCallable())) { + try{ + $this->_injectWorkerService(); $this->_updateJobAsWorking(); - $this->_instantiateWorker(); + $this->_runWorker(); $this->_updateJobAfterWork(); - }else { + }catch(Locator\Exception | \Error $throwable){ $this->_panicJob(); $jobId = $this->_getJob()->getId(); - throw new \RuntimeException("Panicking job[$jobId]."); + throw new \RuntimeException("Panicking job with ID[$jobId].", 0, $throwable); } $this->_getSemaphore()->releaseLock($this->_getNewJobOwnerResource($this->_getJob())); @@ -60,13 +60,23 @@ protected function _workWorker(): ForemanInterface return $this; } - protected function _instantiateWorker(): ForemanInterface + protected function _injectWorkerService(): ForemanInterface + { + $worker = $this->_getLocator()->getClass(); + if (method_exists($worker, 'setApiV1WorkerService')) { + $worker->setApiV1WorkerService($this->_getApiV1WorkerService()); + } + + return $this; + } + + protected function _runWorker(): ForemanInterface { try{ call_user_func($this->_getLocator()->getCallable()); - }catch(\Exception $exception){ + }catch(\Exception $throwable){ $this->_crashJob(); - throw $exception; + throw $throwable; } return $this; @@ -97,7 +107,7 @@ protected function _updateJobAfterWork(): ForemanInterface $stateService = $this->_getStateServiceClone(); $this->_getJob()->load(); $stateService->setJob($this->_getJob()); - if (!$this->_getWorkerJobService()->isRequestApplied() || !$stateService->isValidTransition()) { + if (!$this->_getApiV1WorkerService()->isRequestApplied() || !$stateService->isValidTransition()) { $this->_crashJob(); $jobId = $this->_getJob()->getId(); throw new \LogicException("Worker related to job with ID[$jobId] did not request a next state."); diff --git a/src/Foreman.yml b/src/Foreman.yml index bd83f333..3ad59790 100644 --- a/src/Foreman.yml +++ b/src/Foreman.yml @@ -14,7 +14,7 @@ services: - [setServiceUpdateCrashFactory, ['@service.update.crash.factory']] - [setServiceUpdateCompleteSuccessFactory, ['@service.update.complete.success.factory']] - [setLogger, ['@process.pool.logger']] - - [setWorkerJobService, ['@worker.job.service']] + - [setApiV1WorkerService, ['@api.v1.worker.service']] - [setStateService, ['@state.service']] - [setMessageBroker, ['@message.broker.redis']] foreman: diff --git a/src/ForemanInterface.php b/src/ForemanInterface.php index 3f19834e..ac9290d4 100644 --- a/src/ForemanInterface.php +++ b/src/ForemanInterface.php @@ -4,7 +4,7 @@ namespace Neighborhoods\Kojo; use Neighborhoods\Kojo\Service\Update; -use Neighborhoods\Kojo\Worker; +use Neighborhoods\Kojo\Api\V1\Worker\ServiceInterface; interface ForemanInterface { @@ -14,5 +14,5 @@ public function setServiceUpdateWorkFactory(Update\Work\FactoryInterface $update public function setServiceUpdateCrashFactory(Update\Crash\FactoryInterface $updateCrashFactory); - public function setWorkerJobService(Worker\Job\ServiceInterface $workerJobService); + public function setApiV1WorkerService(ServiceInterface $workerService); } \ No newline at end of file diff --git a/src/Maintainer.php b/src/Maintainer.php index 8cf61461..19e89b15 100644 --- a/src/Maintainer.php +++ b/src/Maintainer.php @@ -92,25 +92,27 @@ public function updatePendingJobs(): MaintainerInterface protected function _updatePendingJobs(): Maintainer { - foreach ($this->_getJobCollectionScheduleLimitCheck()->getIterator() as $job) { + foreach ($this->_getJobCollectionScheduleLimitCheck() as $job) { $jobType = $this->_getTypeRepository()->getJobType($job->getTypeCode()); - $scheduleLimit = $this->_getJobCollectionScheduleLimitByJobType($jobType); - $numberOfScheduledJobs = $scheduleLimit->getNumberOfCurrentlyScheduledJobs(); + $scheduleLimitCollection = $this->_getJobCollectionScheduleLimitByJobType($jobType); + $numberOfScheduledJobs = $scheduleLimitCollection->getNumberOfCurrentlyScheduledJobs(); + $scheduleLimit = $jobType->getScheduleLimit(); try{ - if ($numberOfScheduledJobs < $jobType->getScheduleLimit()) { + if ($numberOfScheduledJobs <= $scheduleLimit) { $waitUpdate = $this->_getServiceUpdateWaitFactory()->create(); $waitUpdate->setJob($job); $waitUpdate->save(); - }else { + }elseif ($numberOfScheduledJobs > $scheduleLimit + $jobType->getScheduleLimitAllowance()) { $failedLimitCheckUpdate = $this->_getServiceUpdateCompleteFailedScheduleLimitCheckFactory()->create(); $failedLimitCheckUpdate->setJob($job); $failedLimitCheckUpdate->save(); + $scheduleLimitCollection->decrementNumberOfCurrentlyScheduledJobs(); } }catch(\Exception $exception){ $updatePanic = $this->_getServiceUpdatePanicFactory()->create(); $updatePanic->setJob($job); $updatePanic->save(); - $this->_getLogger()->alert('Panicking job[' . $job->getId() . '].'); + $this->_getLogger()->alert('Panicking job with ID[' . $job->getId() . '].'); } } diff --git a/src/Message/Broker/Redis.php b/src/Message/Broker/Redis.php index de8ea6f2..6157f3d1 100644 --- a/src/Message/Broker/Redis.php +++ b/src/Message/Broker/Redis.php @@ -21,7 +21,7 @@ public function waitForNewMessage(): BrokerInterface 0 ); }catch(\Exception $exception){ - $this->_getLogger()->warning($exception->getMessage()); + $this->_getLogger()->critical($exception->getMessage()); throw $exception; } @@ -43,7 +43,7 @@ public function hasMessage(): bool $publishChannelLength = $this->getPublishChannelLength(); $subscriptionChannelLength = $this->getSubscriptionChannelLength(); }catch(\Exception $exception){ - $this->_getLogger()->warning($exception->getMessage()); + $this->_getLogger()->critical($exception->getMessage()); throw $exception; } @@ -58,7 +58,7 @@ public function getNextMessage(): string $message = $this->_getRedisClient()->rPop($this->_getPublishChannelName()); } }catch(\Exception $exception){ - $this->_getLogger()->warning($exception->getMessage()); + $this->_getLogger()->critical($exception->getMessage()); throw $exception; } @@ -70,7 +70,7 @@ public function getPublishChannelLength(): int try{ $publishChannelLength = $this->_getRedisClient()->lLen($this->_getPublishChannelName()); }catch(\Exception $exception){ - $this->_getLogger()->warning($exception->getMessage()); + $this->_getLogger()->critical($exception->getMessage()); throw $exception; } @@ -82,7 +82,7 @@ public function getSubscriptionChannelLength(): int try{ $subscriptionChannelLength = $this->_getRedisClient()->lLen($this->_getSubscriptionChannelName()); }catch(\Exception $exception){ - $this->_getLogger()->warning($exception->getMessage()); + $this->_getLogger()->critical($exception->getMessage()); throw $exception; } @@ -94,7 +94,7 @@ public function publishMessage($message): BrokerInterface try{ $this->_getRedisClient()->lPush($this->_getPublishChannelName(), $message); }catch(\Exception $exception){ - $this->_getLogger()->warning($exception->getMessage()); + $this->_getLogger()->critical($exception->getMessage()); throw $exception; } diff --git a/src/Process/Collection.yml b/src/Process/Collection.yml index 033016fb..d94f0643 100644 --- a/src/Process/Collection.yml +++ b/src/Process/Collection.yml @@ -5,7 +5,6 @@ services: calls: - [setIterator, ['@process.collection.iterator']] - [addProcessPrototype, ['@process.listener.command']] - - [addProcessPrototype, ['@process.job.required']] - [addProcessPrototype, ['@process.job']] process.collection: alias: neighborhoods.kojo.process.collection diff --git a/src/Process/Forked.php b/src/Process/Forked.php index 96785e7e..d8d35441 100644 --- a/src/Process/Forked.php +++ b/src/Process/Forked.php @@ -26,7 +26,7 @@ public function start(): ProcessInterface $this->_getProcessSignal()->decrementWaitCount(); $this->_getProcessPool()->start(); $this->_run(); - $this->exit(0); + $this->exit(); } return $this; diff --git a/src/Process/Job.php b/src/Process/Job.php index 6d5e7cdc..f569795c 100644 --- a/src/Process/Job.php +++ b/src/Process/Job.php @@ -21,13 +21,17 @@ class Job extends Forked implements JobInterface protected function _run(): Forked { - $this->_getSelector()->setProcess($this); - $this->_getBootstrap()->instantiate(); - $this->_getMaintainer()->rescheduleCrashedJobs(); - $this->_getScheduler()->scheduleStaticJobs(); - $this->_getMaintainer()->updatePendingJobs(); - $this->_getMaintainer()->deleteCompletedJobs(); - $this->_getForeman()->workWorker(); + try{ + $this->_getSelector()->setProcess($this); + $this->_getBootstrap()->instantiate(); + $this->_getMaintainer()->rescheduleCrashedJobs(); + $this->_getScheduler()->scheduleStaticJobs(); + $this->_getMaintainer()->updatePendingJobs(); + $this->_getMaintainer()->deleteCompletedJobs(); + $this->_getForeman()->workWorker(); + }catch(\Throwable $throwable){ + $this->_setOrReplaceExitCode(255); + } return $this; } diff --git a/src/Process/Job/Required.php b/src/Process/Job/Required.php deleted file mode 100644 index de584729..00000000 --- a/src/Process/Job/Required.php +++ /dev/null @@ -1,11 +0,0 @@ -_getProcessSignal()->block(); - $this->exit(0); + $this->exit(); return $this; } - public function exit(int $exitCode): void + protected function _setOrReplaceExitCode(int $exitCode): ProcessInterface + { + $this->_exitCode = $exitCode; + + return $this; + } + + public function exit(): void { $this->_getProcessSignal()->block(); $this->unregisterShutdownMethod(); $this->_getProcessPool()->terminateChildProcesses(); - exit($exitCode); + exit($this->_exitCode); } public function shutdown(): ProcessInterface { if ($this->_read(self::PROP_IS_SHUTDOWN_METHOD_ACTIVE)) { $this->_getLogger()->critical("Shutdown method invoked."); - $this->exit(255); + $this->_setOrReplaceExitCode(255); + $this->exit(); } return $this; diff --git a/src/ProcessInterface.php b/src/ProcessInterface.php index bee1649d..bd358bd3 100644 --- a/src/ProcessInterface.php +++ b/src/ProcessInterface.php @@ -65,7 +65,7 @@ public function getParentProcessTerminationSignalNumber(); public function setParentProcessTerminationSignalNumber(int $parentProcessTerminationSignalNumber); - public function exit(int $exitCode): void; + public function exit(): void; public function shutdown(): ProcessInterface; diff --git a/src/Scheduler.php b/src/Scheduler.php index 27af4e45..4f17c9ef 100644 --- a/src/Scheduler.php +++ b/src/Scheduler.php @@ -16,7 +16,7 @@ class Scheduler implements SchedulerInterface use Job\Type\Collection\Scheduler\AwareTrait; use Time\AwareTrait; use Defensive\AwareTrait; - use Api\V1\Service\Create\Factory\AwareTrait; + use Service\Create\Factory\AwareTrait; use Semaphore\Resource\Factory\AwareTrait; public function scheduleStaticJobs(): SchedulerInterface diff --git a/src/Selector.php b/src/Selector.php index 7d2e4c20..7df48d1e 100644 --- a/src/Selector.php +++ b/src/Selector.php @@ -40,17 +40,15 @@ protected function _attemptSelect(): SelectorInterface $select->offset($this->_collectionIterations * $this->_getPageSize()); $select->limit($this->_getPageSize()); $jobCandidates = $this->_getSelectorJobCollection()->getModelsArray(); - $publishedMessages = $this->_getMessageBroker()->getPublishChannelLength(); - foreach ($this->_getSelectorJobCollection()->getIterator() as $jobCandidate) { - $processTypeCode = $jobCandidate->getProcessTypeCode(); - $message = json_encode(['command' => "commandProcess.addProcess('$processTypeCode')"]); + $numberOfJobCandidates = count($jobCandidates); + while (true) { + $message = json_encode(['command' => "commandProcess.addProcess('job')"]); $this->_getMessageBroker()->publishMessage($message); - ++$publishedMessages; - if ($publishedMessages >= count($jobCandidates)) { + $publishedMessages = $this->_getMessageBroker()->getPublishChannelLength(); + if ($publishedMessages >= $numberOfJobCandidates) { break; } } - $select->where->and->equalTo(JobInterface::FIELD_NAME_PROCESS_TYPE_CODE, $this->_getProcess()->getTypeCode()); while (!empty($jobCandidates)) { foreach ($this->_getSelectorJobCollection()->getIterator() as $jobCandidate) { diff --git a/src/Service/Create.php b/src/Service/Create.php index e75defd3..ab3daefe 100644 --- a/src/Service/Create.php +++ b/src/Service/Create.php @@ -14,10 +14,10 @@ class Create extends ServiceAbstract implements CreateInterface use Type\Repository\AwareTrait; use Job\Collection\ScheduleLimit\AwareTrait; use Time\AwareTrait; - const PROP_IMPORTANCE = 'importance'; - const PROP_WORK_AT_DATE_TIME = 'work_at_date_time'; - const PROP_JOB_TYPE_CODE = 'job_type_code'; - const PROP_JOB_PREPARED = 'job_prepared'; + protected const PROP_IMPORTANCE = 'importance'; + protected const PROP_WORK_AT_DATE_TIME = 'work_at_date_time'; + protected const PROP_JOB_TYPE_CODE = 'job_type_code'; + protected const PROP_JOB_PREPARED = 'job_prepared'; public function setImportance(int $importance): CreateInterface { @@ -70,11 +70,11 @@ protected function _prepareJob(): Create if ($this->_exists(self::PROP_IMPORTANCE)) { $importance = $this->_read(self::PROP_IMPORTANCE); }else { - $importance = (int) $persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_DEFAULT_IMPORTANCE]; + $importance = (int)$persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_DEFAULT_IMPORTANCE]; } unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_DEFAULT_IMPORTANCE]); }else { - throw new \RuntimeException('Job type with type code ' . $jobType->getCode() . 'is not enabled.'); + throw new \RuntimeException('Job type with type code[' . $jobType->getCode() . '] is not enabled.'); } $job = $this->_getJob(); diff --git a/src/Service/Create/Factory.php b/src/Service/Create/Factory.php index c134df01..59349696 100644 --- a/src/Service/Create/Factory.php +++ b/src/Service/Create/Factory.php @@ -3,7 +3,6 @@ namespace Neighborhoods\Kojo\Service\Create; -use Neighborhoods\Kojo\Api\V1\Service\Create\FactoryInterface; use Neighborhoods\Kojo\Service\CreateInterface; use Neighborhoods\Kojo\State\Service; use Neighborhoods\Kojo\Service\FactoryAbstract; diff --git a/src/Api/V1/Service/Create/Factory/AwareTrait.php b/src/Service/Create/Factory/AwareTrait.php similarity index 84% rename from src/Api/V1/Service/Create/Factory/AwareTrait.php rename to src/Service/Create/Factory/AwareTrait.php index caaae8e3..e67317c6 100644 --- a/src/Api/V1/Service/Create/Factory/AwareTrait.php +++ b/src/Service/Create/Factory/AwareTrait.php @@ -1,9 +1,9 @@ _getJobType()->setScheduleLimitAllowance($scheduleLimitAllowance); + + return $this; + } + public function setIsEnabled(bool $isEnabled): CreateInterface { $this->_getJobType()->setIsEnabled($isEnabled); diff --git a/src/Type/Service/Create/Factory.php b/src/Type/Service/Create/Factory.php index 877a13c4..e1941f0f 100644 --- a/src/Type/Service/Create/Factory.php +++ b/src/Type/Service/Create/Factory.php @@ -3,7 +3,6 @@ namespace Neighborhoods\Kojo\Type\Service\Create; -use Neighborhoods\Kojo\Api\V1\Type\Service\Create\FactoryInterface; use Neighborhoods\Kojo\Service\FactoryAbstract; use Neighborhoods\Kojo\Type\Service\Create; use Neighborhoods\Kojo\Type\Service\CreateInterface; diff --git a/src/Api/V1/Type/Service/Create/Factory/AwareTrait.php b/src/Type/Service/Create/Factory/AwareTrait.php similarity index 83% rename from src/Api/V1/Type/Service/Create/Factory/AwareTrait.php rename to src/Type/Service/Create/Factory/AwareTrait.php index 71996fe4..abbe8f4d 100644 --- a/src/Api/V1/Type/Service/Create/Factory/AwareTrait.php +++ b/src/Type/Service/Create/Factory/AwareTrait.php @@ -1,9 +1,9 @@ _create(ServiceInterface::class, $workerJobService); - - return $this; - } - - protected function _getWorkerJobService(): ServiceInterface - { - return $this->_read(ServiceInterface::class); - } - - protected function _getWorkerJobServiceClone(): ServiceInterface - { - return clone $this->_getJob(); - } -} \ No newline at end of file diff --git a/src/Worker/Locator.php b/src/Worker/Locator.php index ab68285a..f70b835d 100644 --- a/src/Worker/Locator.php +++ b/src/Worker/Locator.php @@ -4,18 +4,45 @@ namespace Neighborhoods\Kojo\Worker; use Neighborhoods\Kojo\Data\Job; +use Neighborhoods\Kojo\Worker\Locator\Exception; use Neighborhoods\Pylon\Data\Property\Defensive; class Locator implements LocatorInterface { use Job\AwareTrait; use Defensive\AwareTrait; + protected $_callable = []; + protected const PROP_CLASS_NAME = 'class_name'; public function getCallable(): callable { - $class = $this->_getJob()->getWorkerUri(); - $object = new $class; + if (empty($this->_callable)) { + try{ + $class = $this->_getJob()->getWorkerUri(); + $this->_create(self::PROP_CLASS_NAME, $class); + $object = new $class; + $method = $this->_getJob()->getWorkerMethod(); + $callable = [$object, $method]; + if (is_callable($callable)) { + $this->_callable = $callable; + }else { + throw new \RuntimeException("Class[$class] and method[$method] is not callable."); + } + }catch(\Throwable $throwable){ + throw new Exception($throwable->getMessage(), Exception::CODE_CANNOT_INSTANTIATE_WORKER, $throwable); + } + } - return [$object, $this->_getJob()->getWorkerMethod()]; + return $this->_callable; + } + + public function getClass() + { + return $this->getCallable()[0]; + } + + public function getClassName(): string + { + return $this->_read(self::PROP_CLASS_NAME); } } \ No newline at end of file diff --git a/src/Worker/Locator/Exception.php b/src/Worker/Locator/Exception.php new file mode 100644 index 00000000..1949c06e --- /dev/null +++ b/src/Worker/Locator/Exception.php @@ -0,0 +1,16 @@ +_addPossibleMessage(self::CODE_CANNOT_INSTANTIATE_WORKER, 'Cannot instantiate worker.'); + + return parent::__construct($message, $code, $previous); + } +} \ No newline at end of file diff --git a/src/Worker/Locator/ExceptionInterface.php b/src/Worker/Locator/ExceptionInterface.php new file mode 100644 index 00000000..ab003d98 --- /dev/null +++ b/src/Worker/Locator/ExceptionInterface.php @@ -0,0 +1,11 @@ +_getContainerBuilderFacade()->getContainerBuilder()->get('process.job'); } - - protected function _getRequiredJobProcess(): JobInterface - { - return $this->_getContainerBuilderFacade()->getContainerBuilder()->get('process.job.required'); - } } \ No newline at end of file diff --git a/tests/ForemanInterfaceTest/ForemanInterfaceTest.yml b/tests/ForemanInterfaceTest/ForemanInterfaceTest.yml deleted file mode 100644 index 6b2a29c9..00000000 --- a/tests/ForemanInterfaceTest/ForemanInterfaceTest.yml +++ /dev/null @@ -1,25 +0,0 @@ -services: - foreman: - public: true - alias: neighborhoods.kojo.foreman - selector: - public: true - alias: neighborhoods.kojo.selector - process.job: - public: true - alias: neighborhoods.kojo.process.job - process.job.required: - public: true - alias: neighborhoods.kojo.process.job.required - db.setup: - public: true - alias: neighborhoods.kojo.db.setup - db.tear_down: - public: true - alias: neighborhoods.kojo.db.tear_down - redis.factory: - public: true - alias: neighborhoods.kojo.redis.factory - db.pdo.builder: - public: true - alias: neighborhoods.kojo.db.pdo.builder diff --git a/tests/ForemanInterfaceTest/fixtures/workWorkers/1_job_types.yml b/tests/ForemanInterfaceTest/fixtures/workWorkers/1_job_types.yml index a9944504..a9195dab 100644 --- a/tests/ForemanInterfaceTest/fixtures/workWorkers/1_job_types.yml +++ b/tests/ForemanInterfaceTest/fixtures/workWorkers/1_job_types.yml @@ -9,10 +9,10 @@ kojo_job_type: default_importance: 10 cron_expression: schedule_limit: 0 + schedule_limit_allowance: 1 is_enabled: 1 auto_complete_success: 1 auto_delete_interval_duration: 'PT0S' - process_type_code: 'job' - kojo_job_type_id: 2 type_code: "type_code_2" @@ -23,7 +23,7 @@ kojo_job_type: default_importance: 10 cron_expression: "* * * * *" schedule_limit: 3 + schedule_limit_allowance: 1 is_enabled: 1 auto_complete_success: 1 - auto_delete_interval_duration: 'PT0S' - process_type_code: 'job.required' \ No newline at end of file + auto_delete_interval_duration: 'PT0S' \ No newline at end of file diff --git a/tests/ForemanInterfaceTest/fixtures/workWorkers/2_jobs.yml b/tests/ForemanInterfaceTest/fixtures/workWorkers/2_jobs.yml index 6100ea50..25636fae 100644 --- a/tests/ForemanInterfaceTest/fixtures/workWorkers/2_jobs.yml +++ b/tests/ForemanInterfaceTest/fixtures/workWorkers/2_jobs.yml @@ -21,7 +21,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job.required' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -44,7 +43,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -67,7 +65,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -90,7 +87,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -113,7 +109,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -136,7 +131,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -159,7 +153,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -182,7 +175,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -205,7 +197,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -228,7 +219,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -251,7 +241,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -274,7 +263,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -297,7 +285,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -320,7 +307,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -343,7 +329,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -366,7 +351,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -389,7 +373,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -412,7 +395,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -435,7 +417,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -458,7 +439,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -481,7 +461,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -504,7 +483,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -527,7 +505,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -550,7 +527,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -573,7 +549,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -596,7 +571,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -619,7 +593,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -642,7 +615,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -665,7 +637,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -688,7 +659,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -711,7 +681,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -734,7 +703,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -757,7 +725,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -780,7 +747,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -803,7 +769,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -826,7 +791,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -849,7 +813,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -872,7 +835,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -895,7 +857,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -918,7 +879,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -941,7 +901,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -964,7 +923,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -987,7 +945,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1010,7 +967,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1033,7 +989,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1056,7 +1011,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1079,7 +1033,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1102,7 +1055,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1125,7 +1077,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1148,7 +1099,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1171,7 +1121,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1194,7 +1143,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1217,7 +1165,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1240,7 +1187,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1263,7 +1209,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1286,7 +1231,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1309,7 +1253,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1332,7 +1275,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1355,7 +1297,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1378,7 +1319,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1401,7 +1341,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1424,7 +1363,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1447,7 +1385,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1470,7 +1407,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1493,7 +1429,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1516,7 +1451,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1539,7 +1473,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1562,7 +1495,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1585,7 +1517,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1608,7 +1539,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1631,7 +1561,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1654,7 +1583,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1677,7 +1605,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1700,7 +1627,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1723,7 +1649,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1746,7 +1671,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1769,7 +1693,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1792,7 +1715,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1815,7 +1737,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1838,7 +1759,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1861,7 +1781,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1884,7 +1803,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1907,7 +1825,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1930,7 +1847,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1953,7 +1869,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1976,7 +1891,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -1999,7 +1913,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2022,7 +1935,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2045,7 +1957,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2068,7 +1979,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2091,7 +2001,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2114,7 +2023,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2137,7 +2045,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2160,7 +2067,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2183,7 +2089,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2206,7 +2111,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2229,7 +2133,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2252,7 +2155,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2275,7 +2177,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2298,7 +2199,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2321,7 +2221,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2344,7 +2243,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2367,7 +2265,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2390,7 +2287,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2413,7 +2309,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2436,7 +2331,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2459,7 +2353,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2482,7 +2375,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2505,7 +2397,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2528,7 +2419,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2551,7 +2441,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2574,7 +2463,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2597,7 +2485,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2620,7 +2507,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2643,7 +2529,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2666,7 +2551,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2689,7 +2573,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2712,7 +2595,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2735,7 +2617,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2758,7 +2639,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2781,7 +2661,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2804,7 +2683,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2827,7 +2705,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2850,7 +2727,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2873,7 +2749,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2896,7 +2771,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2919,7 +2793,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2942,7 +2815,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2965,7 +2837,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -2988,7 +2859,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3011,7 +2881,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3034,7 +2903,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3057,7 +2925,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3080,7 +2947,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3103,7 +2969,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3126,7 +2991,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3149,7 +3013,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3172,7 +3035,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3195,7 +3057,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3218,7 +3079,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3241,7 +3101,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3264,7 +3123,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3287,7 +3145,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3310,7 +3167,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3333,7 +3189,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3356,7 +3211,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3379,7 +3233,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3402,7 +3255,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3425,7 +3277,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3448,7 +3299,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3471,7 +3321,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3494,7 +3343,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3517,7 +3365,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3540,7 +3387,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3563,7 +3409,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3586,7 +3431,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3609,7 +3453,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3632,7 +3475,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3655,7 +3497,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3678,7 +3519,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3701,7 +3541,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3724,7 +3563,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3747,7 +3585,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3770,7 +3607,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3793,7 +3629,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3816,7 +3651,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3839,7 +3673,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3862,7 +3695,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3885,7 +3717,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3908,7 +3739,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3931,7 +3761,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3954,7 +3783,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -3977,7 +3805,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4000,7 +3827,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4023,7 +3849,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4046,7 +3871,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4069,7 +3893,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4092,7 +3915,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4115,7 +3937,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4138,7 +3959,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4161,7 +3981,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4184,7 +4003,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4207,7 +4025,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4230,7 +4047,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4253,7 +4069,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4276,7 +4091,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4299,7 +4113,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4322,7 +4135,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4345,7 +4157,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4368,7 +4179,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4391,7 +4201,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4414,7 +4223,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4437,7 +4245,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4460,7 +4267,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4483,7 +4289,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4506,7 +4311,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4529,7 +4333,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_1" @@ -4552,7 +4355,6 @@ kojo_job: times_crashed: 0 times_panicked: 0 created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job' - kojo_job_id: !fixture/expression: numberPool.advance('job_id').getCurrentNumber('job_id') type_code: "type_code_2" @@ -4574,5 +4376,4 @@ kojo_job: times_held: 0 times_crashed: 0 times_panicked: 0 - created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') - process_type_code: 'job.required' \ No newline at end of file + created_at_date_time: !fixture/expression: time.getNow().format('Y-m-d H:i:s') \ No newline at end of file From 4a36099d2da4093a005fb6c2b5c4f4a003ff7657 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 13:09:40 -0500 Subject: [PATCH 25/44] - worker service interface updates --- src/Api/V1/Worker/Service.php | 5 +++++ src/Api/V1/Worker/ServiceInterface.php | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Api/V1/Worker/Service.php b/src/Api/V1/Worker/Service.php index e55572e1..9caa07ca 100644 --- a/src/Api/V1/Worker/Service.php +++ b/src/Api/V1/Worker/Service.php @@ -114,6 +114,11 @@ public function getLogger(): LoggerInterface return $this->_getApiV1Logger(); } + public function reload(): ServiceInterface + { + return $this; + } + public function getNewJobScheduler(): SchedulerInterface { return $this->_getApiV1JobSchedulerFactory()->create(); diff --git a/src/Api/V1/Worker/ServiceInterface.php b/src/Api/V1/Worker/ServiceInterface.php index 7bb1a7dd..b856450c 100644 --- a/src/Api/V1/Worker/ServiceInterface.php +++ b/src/Api/V1/Worker/ServiceInterface.php @@ -3,6 +3,8 @@ namespace Neighborhoods\Kojo\Api\V1\Worker; +use Neighborhoods\Kojo\Api\V1\Job\SchedulerInterface; +use Neighborhoods\Kojo\Api\V1\LoggerInterface; use Neighborhoods\Kojo\Service\Update\Hold; use Neighborhoods\Kojo\Service\Update\Retry; use Neighborhoods\Kojo\Service\Update\Complete\Success; @@ -33,4 +35,10 @@ public function setServiceUpdateCompleteFailedFactory(Failed\FactoryInterface $u /** @injected:configuration */ public function setServiceUpdateHoldFactory(Hold\FactoryInterface $updateHoldFactory); + + public function getLogger(): LoggerInterface; + + public function getNewJobScheduler(): SchedulerInterface; + + public function reload(): ServiceInterface; } \ No newline at end of file From b9599c2dc11812b79eccd9bc16a3d572369d6cd8 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 13:17:17 -0500 Subject: [PATCH 26/44] - add PSR log level descriptions to logger interface --- src/Api/V1/Logger.php | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Api/V1/Logger.php b/src/Api/V1/Logger.php index bac42881..ebdd5291 100644 --- a/src/Api/V1/Logger.php +++ b/src/Api/V1/Logger.php @@ -15,13 +15,22 @@ public function emergency($message, array $context = array()) $this->_getLogger()->emergency($message, $context); } - /** Action must be taken immediately. */ + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + */ public function alert($message, array $context = array()) { $this->_getLogger()->alert($message, $context); } - /** Critical conditions. */ + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + */ public function critical($message, array $context = array()) { $this->_getLogger()->critical($message, $context); @@ -33,7 +42,12 @@ public function error($message, array $context = array()) $this->_getLogger()->error($message, $context); } - /** Exceptional occurrences that are not errors. */ + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + */ public function warning($message, array $context = array()) { $this->_getLogger()->warning($message, $context); @@ -45,7 +59,11 @@ public function notice($message, array $context = array()) $this->_getLogger()->notice($message, $context); } - /** Interesting events. */ + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + */ public function info($message, array $context = array()) { $this->_getLogger()->info($message, $context); From f3a53d299c54b1a1eaa6a9b5b70aa7de7ab7b4ef Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 13:45:20 -0500 Subject: [PATCH 27/44] wiring --- src/Api/V1/Job/Type/Registrar.php | 4 +++- src/Api/V1/Job/Type/Service.php | 28 +++++++++++++++++++++++++++- src/Type/Service/CreateInterface.php | 2 ++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Api/V1/Job/Type/Registrar.php b/src/Api/V1/Job/Type/Registrar.php index 6c1cd59c..e1fdc9cc 100644 --- a/src/Api/V1/Job/Type/Registrar.php +++ b/src/Api/V1/Job/Type/Registrar.php @@ -4,9 +4,11 @@ namespace Neighborhoods\Kojo\Api\V1\Job\Type; use Neighborhoods\Kojo\Type; +use Neighborhoods\Pylon\Data\Property; class Registrar implements RegistrarInterface { + use Property\Defensive\AwareTrait; use Type\Service\Create\AwareTrait; public function save(): RegistrarInterface @@ -74,7 +76,7 @@ public function setScheduleLimit(int $scheduleLimit): RegistrarInterface public function setScheduleLimitAllowance(int $scheduleLimitAllowance): RegistrarInterface { - $this->_getTypeServiceCreate()->setScheduleLimit($scheduleLimitAllowance); + $this->_getTypeServiceCreate()->setScheduleLimitAllowance($scheduleLimitAllowance); return $this; } diff --git a/src/Api/V1/Job/Type/Service.php b/src/Api/V1/Job/Type/Service.php index fa7123f1..8d03cdc9 100644 --- a/src/Api/V1/Job/Type/Service.php +++ b/src/Api/V1/Job/Type/Service.php @@ -12,6 +12,8 @@ class Service implements ServiceInterface { protected const REGISTRAR_FACTORY_SERVICE_ID = 'api.v1.job.type.registrar.factory'; protected $_containerBuilderFacade; + protected $_kojoDiFinder; + protected $_kojoApplicationDirectoryPath; public function addYmlServiceFinder(Finder $ymlServiceFinder): ServiceInterface { @@ -33,9 +35,33 @@ protected function _getContainerBuilder(): ContainerBuilder protected function _getContainerBuilderFacade(): FacadeInterface { if ($this->_containerBuilderFacade === null) { - $this->_containerBuilderFacade = new Facade(); + $containerBuilderFacade = new Facade(); + $containerBuilderFacade->addFinder($this->_getKojoDiFinder()); + $this->_containerBuilderFacade = $containerBuilderFacade; } return $this->_containerBuilderFacade; } + + protected function _getKojoDiFinder() + { + if ($this->_kojoDiFinder === null) { + $kojoDiFinder = new Finder(); + $kojoDiFinder->name('*.yml'); + $kojoDiFinder->files()->in($this->_getKojoApplicationDirectoryPath()); + + $this->_kojoDiFinder = $kojoDiFinder; + } + + return $this->_kojoDiFinder; + } + + protected function _getKojoApplicationDirectoryPath(): string + { + if ($this->_kojoApplicationDirectoryPath === null) { + $this->_kojoApplicationDirectoryPath = dirname(__FILE__) . '/../../../../../src'; + } + + return $this->_kojoApplicationDirectoryPath; + } } \ No newline at end of file diff --git a/src/Type/Service/CreateInterface.php b/src/Type/Service/CreateInterface.php index 86965020..cf64652f 100644 --- a/src/Type/Service/CreateInterface.php +++ b/src/Type/Service/CreateInterface.php @@ -28,4 +28,6 @@ public function setIsEnabled(bool $isEnabled): CreateInterface; public function setAutoCompleteSuccess(bool $autoCompleteSuccess): CreateInterface; public function setAutoDeleteIntervalDuration(string $autoDeleteIntervalDuration): CreateInterface; + + public function setScheduleLimitAllowance(int $scheduleLimitAllowance): CreateInterface; } \ No newline at end of file From f6f5181dff760d2cb90c9deacb60514de6c32d20 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 14:19:38 -0500 Subject: [PATCH 28/44] wiring --- src/Service/Create.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Service/Create.php b/src/Service/Create.php index ab3daefe..fc817a05 100644 --- a/src/Service/Create.php +++ b/src/Service/Create.php @@ -64,6 +64,7 @@ protected function _prepareJob(): Create unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_ID]); unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_CRON_EXPRESSION]); unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_SCHEDULE_LIMIT]); + unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_SCHEDULE_LIMIT_ALLOWANCE]); unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_IS_ENABLED]); unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_AUTO_COMPLETE_SUCCESS]); unset($persistentJobTypeProperties[Job\TypeInterface::FIELD_NAME_AUTO_DELETE_INTERVAL_DURATION]); From 0b93a5fea2a4618cba1a7214a1b204923da7dc38 Mon Sep 17 00:00:00 2001 From: Ariel Allon Date: Mon, 30 Apr 2018 14:38:17 -0500 Subject: [PATCH 29/44] Add Pylon Defensive\AwareTrait to Api\V1\Job\Scheduler --- src/Api/V1/Job/Scheduler.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Api/V1/Job/Scheduler.php b/src/Api/V1/Job/Scheduler.php index 56262ee9..e8238195 100644 --- a/src/Api/V1/Job/Scheduler.php +++ b/src/Api/V1/Job/Scheduler.php @@ -4,9 +4,11 @@ namespace Neighborhoods\Kojo\Api\V1\Job; use Neighborhoods\Kojo\Service; +use Neighborhoods\Pylon\Data\Property\Defensive; class Scheduler implements SchedulerInterface { + use Defensive\AwareTrait; use Service\Create\AwareTrait; public function setJobTypeCode(string $jobTypeCode): SchedulerInterface @@ -41,4 +43,4 @@ public function save(): SchedulerInterface return $this; } -} \ No newline at end of file +} From 6af31913203483bb2fc977f9da19dec473182da7 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:02:59 -0500 Subject: [PATCH 30/44] normalize DSN URI - ty @Rashaud <3 --- src/Db/PDO/Builder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Db/PDO/Builder.php b/src/Db/PDO/Builder.php index d9017ee7..bde36aea 100644 --- a/src/Db/PDO/Builder.php +++ b/src/Db/PDO/Builder.php @@ -8,6 +8,7 @@ class Builder implements BuilderInterface { use Defensive\AwareTrait; + public const REGEX_DSN_URI = '/([^:]+):/'; protected const PROP_DATA_SOURCE_NAME = 'data_source_name'; protected const PROP_USER_NAME = 'user_name'; protected const PROP_PASSWORD = 'password'; @@ -33,7 +34,10 @@ public function getPdo(): \PDO public function setDataSourceName(string $dataSourceName): BuilderInterface { - $this->_create(self::PROP_DATA_SOURCE_NAME, $dataSourceName); + $normalizedDataSourceName = preg_replace_callback(self::REGEX_DSN_URI, function ($matches){ + return strtolower($matches[0]); + }, $dataSourceName, 1); + $this->_create(self::PROP_DATA_SOURCE_NAME, $normalizedDataSourceName); return $this; } From ab47317433452ec8e70697e1c48f4816e2d5697c Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:14:23 -0500 Subject: [PATCH 31/44] add the job model to the worker service --- src/Api/V1/Worker/Service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Api/V1/Worker/Service.yml b/src/Api/V1/Worker/Service.yml index c4fe6e75..5b556da2 100644 --- a/src/Api/V1/Worker/Service.yml +++ b/src/Api/V1/Worker/Service.yml @@ -8,5 +8,6 @@ services: - [setServiceUpdateHoldFactory, ['@service.update.hold.factory']] - [setServiceUpdateRetryFactory, ['@service.update.retry.factory']] - [setApiV1JobSchedulerFactory, ['@api.v1.job.scheduler.factory']] + - [setJob, ['@data.job']] api.v1.worker.service: alias: neighborhoods.kojo.api.v1.worker.service \ No newline at end of file From f5cdf9dc70f48a93ba4cfa4a0bb444d2af21abb8 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:16:27 -0500 Subject: [PATCH 32/44] oops --- src/Api/V1/Worker/Service.yml | 1 - src/Api/V1/Worker/ServiceInterface.php | 14 +++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Api/V1/Worker/Service.yml b/src/Api/V1/Worker/Service.yml index 5b556da2..c4fe6e75 100644 --- a/src/Api/V1/Worker/Service.yml +++ b/src/Api/V1/Worker/Service.yml @@ -8,6 +8,5 @@ services: - [setServiceUpdateHoldFactory, ['@service.update.hold.factory']] - [setServiceUpdateRetryFactory, ['@service.update.retry.factory']] - [setApiV1JobSchedulerFactory, ['@api.v1.job.scheduler.factory']] - - [setJob, ['@data.job']] api.v1.worker.service: alias: neighborhoods.kojo.api.v1.worker.service \ No newline at end of file diff --git a/src/Api/V1/Worker/ServiceInterface.php b/src/Api/V1/Worker/ServiceInterface.php index b856450c..2b16760b 100644 --- a/src/Api/V1/Worker/ServiceInterface.php +++ b/src/Api/V1/Worker/ServiceInterface.php @@ -5,6 +5,7 @@ use Neighborhoods\Kojo\Api\V1\Job\SchedulerInterface; use Neighborhoods\Kojo\Api\V1\LoggerInterface; +use Neighborhoods\Kojo\Data\JobInterface; use Neighborhoods\Kojo\Service\Update\Hold; use Neighborhoods\Kojo\Service\Update\Retry; use Neighborhoods\Kojo\Service\Update\Complete\Success; @@ -24,6 +25,12 @@ public function applyRequest(): ServiceInterface; public function isRequestApplied(): bool; + public function getLogger(): LoggerInterface; + + public function getNewJobScheduler(): SchedulerInterface; + + public function reload(): ServiceInterface; + /** @injected:configuration */ public function setServiceUpdateRetryFactory(Retry\FactoryInterface $updateRetryFactory); @@ -36,9 +43,6 @@ public function setServiceUpdateCompleteFailedFactory(Failed\FactoryInterface $u /** @injected:configuration */ public function setServiceUpdateHoldFactory(Hold\FactoryInterface $updateHoldFactory); - public function getLogger(): LoggerInterface; - - public function getNewJobScheduler(): SchedulerInterface; - - public function reload(): ServiceInterface; + /** @injected:runtime */ + public function setJob(JobInterface $job); } \ No newline at end of file From 22d6f8831c2fa21ae9d08d9533d0e1fe5f51e7fe Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:17:23 -0500 Subject: [PATCH 33/44] I hate myself. --- src/Foreman.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Foreman.php b/src/Foreman.php index 815c7a9e..efce2ddd 100644 --- a/src/Foreman.php +++ b/src/Foreman.php @@ -64,7 +64,7 @@ protected function _injectWorkerService(): ForemanInterface { $worker = $this->_getLocator()->getClass(); if (method_exists($worker, 'setApiV1WorkerService')) { - $worker->setApiV1WorkerService($this->_getApiV1WorkerService()); + $worker->setApiV1WorkerService($this->_getApiV1WorkerService()->setJob($this->_getJob())); } return $this; From 68a146127ad959f1142ecefa6f99f8cb3a4f4b00 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:36:05 -0500 Subject: [PATCH 34/44] bug fixes --- example/Worker.php | 2 ++ src/Foreman.php | 2 +- src/Service/Update/Complete/Success/Factory.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/example/Worker.php b/example/Worker.php index b9eb6953..1a9113df 100644 --- a/example/Worker.php +++ b/example/Worker.php @@ -13,6 +13,8 @@ class Worker public function work() { + $this->_getApiV1WorkerService()->requestCompleteSuccess()->applyRequest(); + return $this; } } \ No newline at end of file diff --git a/src/Foreman.php b/src/Foreman.php index efce2ddd..3f391994 100644 --- a/src/Foreman.php +++ b/src/Foreman.php @@ -107,7 +107,7 @@ protected function _updateJobAfterWork(): ForemanInterface $stateService = $this->_getStateServiceClone(); $this->_getJob()->load(); $stateService->setJob($this->_getJob()); - if (!$this->_getApiV1WorkerService()->isRequestApplied() || !$stateService->isValidTransition()) { + if (!$this->_getApiV1WorkerService()->isRequestApplied()) { $this->_crashJob(); $jobId = $this->_getJob()->getId(); throw new \LogicException("Worker related to job with ID[$jobId] did not request a next state."); diff --git a/src/Service/Update/Complete/Success/Factory.php b/src/Service/Update/Complete/Success/Factory.php index b67a2045..da1b9284 100644 --- a/src/Service/Update/Complete/Success/Factory.php +++ b/src/Service/Update/Complete/Success/Factory.php @@ -15,7 +15,7 @@ class Factory extends FactoryAbstract implements FactoryInterface public function create(): SuccessInterface { - $updateCompleteSuccess = $this->_getServiceUpdateCompleteSuccess(); + $updateCompleteSuccess = $this->_getServiceUpdateCompleteSuccessClone(); $stateService = $this->_getStateServiceClone(); $updateCompleteSuccess->setStateService($stateService); From 87ab77e682208e86150f73cbd6ef1d6acc7c236a Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:41:21 -0500 Subject: [PATCH 35/44] bug fixes --- src/Selector.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Selector.php b/src/Selector.php index 7df48d1e..cd0a7a27 100644 --- a/src/Selector.php +++ b/src/Selector.php @@ -41,13 +41,14 @@ protected function _attemptSelect(): SelectorInterface $select->limit($this->_getPageSize()); $jobCandidates = $this->_getSelectorJobCollection()->getModelsArray(); $numberOfJobCandidates = count($jobCandidates); + $publishedMessages = $this->_getMessageBroker()->getPublishChannelLength(); while (true) { $message = json_encode(['command' => "commandProcess.addProcess('job')"]); - $this->_getMessageBroker()->publishMessage($message); - $publishedMessages = $this->_getMessageBroker()->getPublishChannelLength(); if ($publishedMessages >= $numberOfJobCandidates) { break; } + $this->_getMessageBroker()->publishMessage($message); + $publishedMessages = $this->_getMessageBroker()->getPublishChannelLength(); } while (!empty($jobCandidates)) { From ae2cf758ab06991e44a34a30979c19ee437ab0a7 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 15:54:00 -0500 Subject: [PATCH 36/44] bug fixes --- src/Data/Job/Collection/ScheduleLimit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Data/Job/Collection/ScheduleLimit.php b/src/Data/Job/Collection/ScheduleLimit.php index abdeee75..c6ee336b 100644 --- a/src/Data/Job/Collection/ScheduleLimit.php +++ b/src/Data/Job/Collection/ScheduleLimit.php @@ -65,7 +65,9 @@ protected function _prepareCollection(): Db\Model\CollectionAbstract ->nest() ->equalTo(JobInterface::FIELD_NAME_ASSIGNED_STATE, State\Service::STATE_WORKING) ->or - ->equalTo(JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, State\Service::STATE_WORKING); + ->equalTo(JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, State\Service::STATE_WORKING) + ->or + ->equalTo(JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, State\Service::STATE_SCHEDULE_LIMIT_CHECK); return $this; } From b0c6a99315823fabf736726c916a9e98ea3f6ef3 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 17:38:37 -0500 Subject: [PATCH 37/44] bug fixes - nullable most recent process ID and and host name - updates for per test case fixtures to comply with scaffolding updates - agent reviews smoke test --- src/Db/Setup/Schema/Version_5_0_0.php | 4 +- tests/BehaviorSmokeTest/BehaviorSmokeTest.php | 6 + .../fixtures}/1_job_types.yml | 0 .../dataSet1 => dataSet1/fixtures}/2_jobs.yml | 0 .../dataSet2/fixtures/1_job_type.yml | 14 + .../dataSet2/fixtures/2_job.yml | 1001 +++++++++++++++++ 6 files changed, 1023 insertions(+), 2 deletions(-) rename tests/BehaviorSmokeTest/{fixtures/dataSet1 => dataSet1/fixtures}/1_job_types.yml (100%) rename tests/BehaviorSmokeTest/{fixtures/dataSet1 => dataSet1/fixtures}/2_jobs.yml (100%) create mode 100644 tests/BehaviorSmokeTest/dataSet2/fixtures/1_job_type.yml create mode 100644 tests/BehaviorSmokeTest/dataSet2/fixtures/2_job.yml diff --git a/src/Db/Setup/Schema/Version_5_0_0.php b/src/Db/Setup/Schema/Version_5_0_0.php index e7170eee..bb6c732f 100644 --- a/src/Db/Setup/Schema/Version_5_0_0.php +++ b/src/Db/Setup/Schema/Version_5_0_0.php @@ -173,13 +173,13 @@ public function assembleSchemaChanges(): VersionInterface ])); $createTable->addColumn( new Varchar( - JobInterface::FIELD_NAME_MOST_RECENT_HOST_NAME, 255, false, null, + JobInterface::FIELD_NAME_MOST_RECENT_HOST_NAME, 255, true, null, [ 'comment' => 'COMMENT', ])); $createTable->addColumn( new Integer( - JobInterface::FIELD_NAME_MOST_RECENT_PROCESS_ID, false, null, + JobInterface::FIELD_NAME_MOST_RECENT_PROCESS_ID, true, null, [ 'comment' => 'COMMENT', 'unsigned' => true, diff --git a/tests/BehaviorSmokeTest/BehaviorSmokeTest.php b/tests/BehaviorSmokeTest/BehaviorSmokeTest.php index 20a63cf5..a1011a52 100644 --- a/tests/BehaviorSmokeTest/BehaviorSmokeTest.php +++ b/tests/BehaviorSmokeTest/BehaviorSmokeTest.php @@ -12,4 +12,10 @@ public function dataSet1(): BehaviorSmokeTest { return $this; } + + /** @test */ + public function dataSet2(): BehaviorSmokeTest + { + return $this; + } } \ No newline at end of file diff --git a/tests/BehaviorSmokeTest/fixtures/dataSet1/1_job_types.yml b/tests/BehaviorSmokeTest/dataSet1/fixtures/1_job_types.yml similarity index 100% rename from tests/BehaviorSmokeTest/fixtures/dataSet1/1_job_types.yml rename to tests/BehaviorSmokeTest/dataSet1/fixtures/1_job_types.yml diff --git a/tests/BehaviorSmokeTest/fixtures/dataSet1/2_jobs.yml b/tests/BehaviorSmokeTest/dataSet1/fixtures/2_jobs.yml similarity index 100% rename from tests/BehaviorSmokeTest/fixtures/dataSet1/2_jobs.yml rename to tests/BehaviorSmokeTest/dataSet1/fixtures/2_jobs.yml diff --git a/tests/BehaviorSmokeTest/dataSet2/fixtures/1_job_type.yml b/tests/BehaviorSmokeTest/dataSet2/fixtures/1_job_type.yml new file mode 100644 index 00000000..d67e1116 --- /dev/null +++ b/tests/BehaviorSmokeTest/dataSet2/fixtures/1_job_type.yml @@ -0,0 +1,14 @@ +kojo_job_type: + - kojo_job_type_id: '1' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + default_importance: '10' + cron_expression: "* * * * *" + schedule_limit: '10' + schedule_limit_allowance: '1' + is_enabled: '1' + auto_complete_success: '0' + auto_delete_interval_duration: "PT0S" \ No newline at end of file diff --git a/tests/BehaviorSmokeTest/dataSet2/fixtures/2_job.yml b/tests/BehaviorSmokeTest/dataSet2/fixtures/2_job.yml new file mode 100644 index 00000000..923f125d --- /dev/null +++ b/tests/BehaviorSmokeTest/dataSet2/fixtures/2_job.yml @@ -0,0 +1,1001 @@ +kojo_job: + - kojo_job_id: '2' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:23:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:09:47 + last_transition_micro_time: '1525118987525328' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '3' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:24:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:09:59 + last_transition_micro_time: '1525118999466217' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '4' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:25:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:12:00 + last_transition_micro_time: '1525119120264405' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '5' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:26:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:13:48 + last_transition_micro_time: '1525119228838578' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '6' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:27:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:15:20 + last_transition_micro_time: '1525119320062890' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '7' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:28:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:16:10 + last_transition_micro_time: '1525119370387988' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '8' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:29:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:16:22 + last_transition_micro_time: '1525119382533304' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '9' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:30:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:29:36 + last_transition_micro_time: '1525120176340327' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '10' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:31:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:30:02 + last_transition_micro_time: '1525120202306093' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '11' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:34:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:47:28 + last_transition_micro_time: '1525121248641458' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '12' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:35:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581630710' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '13' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:36:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581636667' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '14' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:37:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581644111' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '15' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:38:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581651200' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '16' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:39:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717855916' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '17' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '0' + importance: '0' + status_id: + work_at_date_time: 2018-04-30 19:34:54 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581613946' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:54 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '18' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:09:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717821446' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:09:48 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '19' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:10:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716092219' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:09:48 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '20' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:11:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717867295' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:09:48 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '27' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:18:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718335847' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:13:53 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '29' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:19:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581726975' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:15:21 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '30' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:20:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718446827' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:15:21 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '31' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:21:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718725372' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:16:12 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '32' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:29:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581745361' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:29:39 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '33' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:30:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718255557' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:29:39 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '34' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:31:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716262394' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:29:39 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '38' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:35:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581782410' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:30:04 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '39' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:47:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581787662' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '40' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:48:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581794319' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '41' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:49:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717973651' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '42' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:50:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581805940' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '43' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:51:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717778582' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '44' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:52:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717927648' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '45' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '0' + importance: '0' + status_id: + work_at_date_time: 2018-04-30 20:51:15 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581817620' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:51:15 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '46' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:53:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716323544' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '49' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:56:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581574489' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '50' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:57:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581580374' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '51' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:58:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581586732' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '54' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:59:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:54:02 + last_transition_micro_time: '1525121642310586' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:54:02 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '63' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 21:00:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716355175' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:55:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' From 9b0a530ddf1a046507c5fbfa49c97b8a792ebfa9 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Mon, 30 Apr 2018 18:25:01 -0500 Subject: [PATCH 38/44] bug fixes - set redis connection name in parent process. - panic job upon not setting a state if autocomplete success is not set to true --- src/Foreman.php | 5 +---- src/Semaphore/Mutex/Redis.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Foreman.php b/src/Foreman.php index 3f391994..ffd219a6 100644 --- a/src/Foreman.php +++ b/src/Foreman.php @@ -104,11 +104,8 @@ protected function _updateJobAfterWork(): ForemanInterface $updateCompleteSuccess->setJob($this->_getJob()); $updateCompleteSuccess->save(); }else { - $stateService = $this->_getStateServiceClone(); - $this->_getJob()->load(); - $stateService->setJob($this->_getJob()); if (!$this->_getApiV1WorkerService()->isRequestApplied()) { - $this->_crashJob(); + $this->_panicJob(); $jobId = $this->_getJob()->getId(); throw new \LogicException("Worker related to job with ID[$jobId] did not request a next state."); } diff --git a/src/Semaphore/Mutex/Redis.php b/src/Semaphore/Mutex/Redis.php index fd2afd8f..cb6e175e 100644 --- a/src/Semaphore/Mutex/Redis.php +++ b/src/Semaphore/Mutex/Redis.php @@ -23,10 +23,12 @@ class Redis extends MutexAbstract implements RedisInterface public function testAndSetLock(): bool { if ($this->_hasLock === false) { - $this->_getRedisClient()->watch($this->_getKey()); + $key = $this->_getKey(); + $processUUID = $this->_getProcessUuid(); + $this->_getRedisClient()->watch($key); // If the mutex resource ID is set, then check if the owning client is connected. - $mutexKeyValue = $this->_getRedisClient()->get($this->_getKey()); + $mutexKeyValue = $this->_getRedisClient()->get($key); if (!empty($mutexKeyValue)) { $mutexClientIsConnected = false; @@ -43,7 +45,7 @@ public function testAndSetLock(): bool if ($mutexClientIsConnected === false) { // If not, try to obtain the lock by registering on the mutex resource ID. $this->_getRedisClient()->multi(); - $this->_getRedisClient()->set($this->_getKey(), $this->_getParentProcessUuid()); + $this->_getRedisClient()->set($key, $processUUID); $reply = $this->_getRedisClient()->exec(); // If the mutex resource ID was not set by another client, the mutex is obtained by this client. @@ -54,7 +56,7 @@ public function testAndSetLock(): bool }else { // If the mutex resource ID is not set, try to obtain the mutex. $this->_getRedisClient()->multi(); - $this->_getRedisClient()->set($this->_getKey(), $this->_getParentProcessUuid()); + $this->_getRedisClient()->set($key, $processUUID); $reply = $this->_getRedisClient()->exec(); if (is_array($reply) && $reply[0] === true) { $this->_hasLock = true; @@ -87,7 +89,7 @@ public function hasLock(): bool return $this->_hasLock; } - protected function _getParentProcessUuid(): string + protected function _getProcessUuid(): string { return $this->_getProcessRegistry()->getLastRegisteredProcess()->getUuid(); } @@ -106,7 +108,7 @@ protected function _getRedisClient(): \Redis { if (!$this->_exists(self::PROP_REDIS)) { $redis = $this->_getRedisRepository()->getById(RedisInterface::class); - + $redis->client('SETNAME', $this->_getProcessUuid()); $this->_create(self::PROP_REDIS, $redis); } From 96be1de8e2377f33e884e8d3635d94c7df3b286d Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Tue, 1 May 2018 09:21:32 -0500 Subject: [PATCH 39/44] Basic APM Support - New Relic - paid off some DI YML debt --- src/Apm/NewRelic.php | 76 ++++++++++++++++++++++++++++ src/Apm/NewRelic.yml | 8 +++ src/Apm/NewRelic/AwareTrait.php | 38 ++++++++++++++ src/Apm/NewRelicInterface.php | 21 ++++++++ src/Foreman.php | 7 +++ src/Foreman.yml | 1 + src/Process/Job.yml | 7 ++- src/Process/Listener/Command.yml | 6 +-- src/Process/Listener/Mutex/Redis.yml | 6 +-- src/Process/Pool/Server.yml | 7 ++- src/Process/Root.yml | 9 ++-- src/ProcessAbstract.php | 4 ++ src/ProcessAbstract.yml | 14 +++++ src/Worker/Locator.php | 15 ++++-- src/Worker/LocatorInterface.php | 2 + 15 files changed, 198 insertions(+), 23 deletions(-) create mode 100644 src/Apm/NewRelic.php create mode 100644 src/Apm/NewRelic.yml create mode 100644 src/Apm/NewRelic/AwareTrait.php create mode 100644 src/Apm/NewRelicInterface.php create mode 100644 src/ProcessAbstract.yml diff --git a/src/Apm/NewRelic.php b/src/Apm/NewRelic.php new file mode 100644 index 00000000..98e50d6a --- /dev/null +++ b/src/Apm/NewRelic.php @@ -0,0 +1,76 @@ +_create(self::PROP_APPLICATION_NAME, $applicationName); + + return $this; + } + + protected function _getApplicationName(): string + { + if (!$this->_exists(self::PROP_APPLICATION_NAME)) { + $this->_create(self::PROP_APPLICATION_NAME, ini_get("newrelic.appname")); + } + + return $this->_read(self::PROP_APPLICATION_NAME); + } + + public function startTransaction(): NewRelicInterface + { + if (extension_loaded(self::NEW_RELIC_EXTENSION_NAME)) { + newrelic_start_transaction($this->_getApplicationName()); + } + + return $this; + } + + public function endTransaction(): NewRelicInterface + { + if (extension_loaded(self::NEW_RELIC_EXTENSION_NAME)) { + newrelic_end_transaction(); + } + + return $this; + } + + public function ignoreTransaction(): NewRelicInterface + { + if (extension_loaded(self::NEW_RELIC_EXTENSION_NAME)) { + newrelic_ignore_transaction(); + } + + return $this; + } + + public function nameTransaction(string $name): NewRelicInterface + { + if (extension_loaded(self::NEW_RELIC_EXTENSION_NAME)) { + newrelic_name_transaction($name); + } + + return $this; + } + + public function addCustomParameter(string $key, $value): NewRelicInterface + { + if (!is_scalar($value)) { + throw new \InvalidArgumentException("Value is not a scalar."); + } + if (extension_loaded(self::NEW_RELIC_EXTENSION_NAME)) { + newrelic_add_custom_parameter($key, $value); + } + + return $this; + } +} \ No newline at end of file diff --git a/src/Apm/NewRelic.yml b/src/Apm/NewRelic.yml new file mode 100644 index 00000000..bd076463 --- /dev/null +++ b/src/Apm/NewRelic.yml @@ -0,0 +1,8 @@ +services: + neighborhoods.kojo.apm.new_relic: + class: Neighborhoods\Kojo\Apm\NewRelic + public: false + shared: true + apm.new_relic: + alias: neighborhoods.kojo.apm.new_relic + public: false \ No newline at end of file diff --git a/src/Apm/NewRelic/AwareTrait.php b/src/Apm/NewRelic/AwareTrait.php new file mode 100644 index 00000000..d09f8957 --- /dev/null +++ b/src/Apm/NewRelic/AwareTrait.php @@ -0,0 +1,38 @@ +_create(NewRelicInterface::class, $apmNewRelic); + + return $this; + } + + protected function _getApmNewRelic(): NewRelicInterface + { + return $this->_read(NewRelicInterface::class); + } + + protected function _getApmNewRelicClone(): NewRelicInterface + { + return clone $this->_getApmNewRelic(); + } + + protected function _hasApmNewRelic(): bool + { + return $this->_exists(NewRelicInterface::class); + } + + protected function _unsetApmNewRelic(): self + { + $this->_delete(NewRelicInterface::class); + + return $this; + } +} \ No newline at end of file diff --git a/src/Apm/NewRelicInterface.php b/src/Apm/NewRelicInterface.php new file mode 100644 index 00000000..671752bf --- /dev/null +++ b/src/Apm/NewRelicInterface.php @@ -0,0 +1,21 @@ +_getApmNewRelic()->startTransaction(); + $className = $this->_getLocator()->getClassName(); + $methodName = $this->_getLocator()->getMethodName(); + $this->_getApmNewRelic()->nameTransaction($className . '::' . $methodName); call_user_func($this->_getLocator()->getCallable()); + $this->_getApmNewRelic()->endTransaction(); }catch(\Exception $throwable){ $this->_crashJob(); throw $throwable; diff --git a/src/Foreman.yml b/src/Foreman.yml index 3ad59790..d89fe794 100644 --- a/src/Foreman.yml +++ b/src/Foreman.yml @@ -17,6 +17,7 @@ services: - [setApiV1WorkerService, ['@api.v1.worker.service']] - [setStateService, ['@state.service']] - [setMessageBroker, ['@message.broker.redis']] + - [setApmNewRelic, ['@apm.new_relic']] foreman: alias: neighborhoods.kojo.foreman public: false \ No newline at end of file diff --git a/src/Process/Job.yml b/src/Process/Job.yml index 8177893f..207c747f 100644 --- a/src/Process/Job.yml +++ b/src/Process/Job.yml @@ -1,9 +1,10 @@ services: neighborhoods.kojo.process.job: - shared: false class: Neighborhoods\Kojo\Process\Job + public: true + shared: false + parent: process_abstract calls: - - [setLogger, ['@process.pool.logger']] - [setForeman, ['@foreman']] - [setMaintainer, ['@maintainer']] - [setScheduler, ['@scheduler']] @@ -13,9 +14,7 @@ services: - [setProcessStrategy, ['@process.strategy.process_control']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] - - [setProcessRegistry, ['@process.registry']] - [setProcessPoolFactory, ['@process.pool.factory-job']] - - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.job: alias: neighborhoods.kojo.process.job \ No newline at end of file diff --git a/src/Process/Listener/Command.yml b/src/Process/Listener/Command.yml index b468be7d..b3468c7e 100644 --- a/src/Process/Listener/Command.yml +++ b/src/Process/Listener/Command.yml @@ -1,19 +1,19 @@ services: neighborhoods.kojo.process.listener.command: class: Neighborhoods\Kojo\Process\Listener\Command + public: true + shared: false + parent: process_abstract calls: - [setTypeCode, ['listener.command']] - [setBrokerTypeCollection, ['@neighborhoods.kojo.message.broker.type.collection-job']] - [setBrokerTypeCode, ['job_broker']] - - [setLogger, ['@process.pool.logger']] - [setExpressionLanguage, ['@symfony.component.expressionlanguage.expressionlanguage']] - [setProcessCollection, ['@process.collection']] - [setProcessStrategy, ['@process.strategy.process_control']] - - [setProcessRegistry, ['@process.registry']] - [setTerminationSignalNumber, ['@=constant("SIGKILL")']] - [setUuidMaximumInteger, [9999999999]] - [setProcessPoolFactory, ['@process.pool.factory-empty']] - - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.listener.command: alias: neighborhoods.kojo.process.listener.command \ No newline at end of file diff --git a/src/Process/Listener/Mutex/Redis.yml b/src/Process/Listener/Mutex/Redis.yml index 5323162d..b087a8e9 100644 --- a/src/Process/Listener/Mutex/Redis.yml +++ b/src/Process/Listener/Mutex/Redis.yml @@ -1,20 +1,18 @@ services: neighborhoods.kojo.process.listener.mutex.redis: class: Neighborhoods\Kojo\Process\Listener\Mutex\Redis - public: false + public: true shared: false + parent: process_abstract calls: - [setTypeCode, ['listener.mutex.redis']] - - [setLogger, ['@process.pool.logger']] - [setProcessStrategy, ['@process.strategy.process_control']] - - [setProcessRegistry, ['@process.registry']] - [setTerminationSignalNumber, ['@=constant("SIGKILL")']] - [setUuidMaximumInteger, [9999999999]] - [setBrokerTypeCollection, ['@neighborhoods.kojo.message.broker.type.collection-job']] - [setBrokerTypeCode, ['process.listener.mutex.redis']] - [setProcessPoolFactory, ['@process.pool.factory-empty']] - [setRedisFactory, ['@redis.factory']] - - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.listener.mutex.redis: alias: neighborhoods.kojo.process.listener.mutex.redis diff --git a/src/Process/Pool/Server.yml b/src/Process/Pool/Server.yml index e12bde95..a17d5064 100644 --- a/src/Process/Pool/Server.yml +++ b/src/Process/Pool/Server.yml @@ -1,17 +1,16 @@ services: neighborhoods.kojo.process.pool.server: - public: true class: Neighborhoods\Kojo\Process\Pool\Server + public: true + shared: false + parent: process_abstract calls: - - [setLogger, ['@process.pool.logger']] - [setSemaphore, ['@semaphore']] - [addSemaphoreResourceFactory, ['@semaphore.resource.factory-server']] - [setProcessPoolFactory, ['@process.pool.factory-server']] - [setTypeCode, ['server']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] - - [setProcessRegistry, ['@process.registry']] - - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.pool.server: public: true diff --git a/src/Process/Root.yml b/src/Process/Root.yml index 4268cc0b..82c9c1b9 100644 --- a/src/Process/Root.yml +++ b/src/Process/Root.yml @@ -1,14 +1,15 @@ services: neighborhoods.kojo.process.root: class: Neighborhoods\Kojo\Process\Root + public: true + shared: false + parent: process_abstract calls: - [setProcessPoolFactory, ['@process.pool.factory']] - - [setLogger, ['@process.pool.logger']] - [setProcessStrategy, ['@process.strategy.process_control']] - [setTerminationSignalNumber, ['@=constant("SIGTERM")']] - [setUuidMaximumInteger, [9999999999]] - - [setProcessRegistry, ['@process.registry']] - - [setProcessSignal, ['@process.signal']] - [setTitlePrefix, ['%process.title.prefix%']] process.root: - alias: neighborhoods.kojo.process.root \ No newline at end of file + alias: neighborhoods.kojo.process.root + public: false \ No newline at end of file diff --git a/src/ProcessAbstract.php b/src/ProcessAbstract.php index 13a9f733..ea594f9d 100644 --- a/src/ProcessAbstract.php +++ b/src/ProcessAbstract.php @@ -8,6 +8,7 @@ use Neighborhoods\Kojo\Process\Signal\HandlerInterface; use Neighborhoods\Kojo\Process\Signal\InformationInterface; use Neighborhoods\Pylon\Data\Property\Defensive; +use Neighborhoods\Kojo\Apm; abstract class ProcessAbstract implements ProcessInterface { @@ -18,10 +19,13 @@ abstract class ProcessAbstract implements ProcessInterface use Process\Signal\AwareTrait; use Defensive\AwareTrait; use Logger\AwareTrait; + use Apm\NewRelic\AwareTrait; protected $_exitCode = 0; protected function _initialize(): ProcessAbstract { + $this->_getApmNewRelic()->ignoreTransaction(); + $this->_getApmNewRelic()->endTransaction(); $this->_getProcessSignal()->incrementWaitCount(); $this->_setParentProcessId(posix_getppid()); $this->_setProcessId(posix_getpid()); diff --git a/src/ProcessAbstract.yml b/src/ProcessAbstract.yml new file mode 100644 index 00000000..675a20d9 --- /dev/null +++ b/src/ProcessAbstract.yml @@ -0,0 +1,14 @@ +services: + neighborhoods.kojo.process_abstract: + class: Neighborhoods\Kojo\ProcessAbstract + abstract: true + public: false + shared: false + calls: + - [setProcessRegistry, ['@process.registry']] + - [setLogger, ['@process.pool.logger']] + - [setProcessSignal, ['@process.signal']] + - [setApmNewRelic, ['@apm.new_relic']] + process_abstract: + alias: neighborhoods.kojo.process_abstract + public: false \ No newline at end of file diff --git a/src/Worker/Locator.php b/src/Worker/Locator.php index f70b835d..cbfdd6c4 100644 --- a/src/Worker/Locator.php +++ b/src/Worker/Locator.php @@ -11,17 +11,24 @@ class Locator implements LocatorInterface { use Job\AwareTrait; use Defensive\AwareTrait; + protected const PROP_METHOD_NAME = 'method_name'; + protected const PROP_CLASS_NAME = 'class_name'; protected $_callable = []; - protected const PROP_CLASS_NAME = 'class_name'; + + public function getClass() + { + return $this->getCallable()[0]; + } public function getCallable(): callable { if (empty($this->_callable)) { try{ $class = $this->_getJob()->getWorkerUri(); + $method = $this->_getJob()->getWorkerMethod(); $this->_create(self::PROP_CLASS_NAME, $class); + $this->_create(self::PROP_METHOD_NAME, $method); $object = new $class; - $method = $this->_getJob()->getWorkerMethod(); $callable = [$object, $method]; if (is_callable($callable)) { $this->_callable = $callable; @@ -36,9 +43,9 @@ public function getCallable(): callable return $this->_callable; } - public function getClass() + public function getMethodName(): string { - return $this->getCallable()[0]; + return $this->_read(self::PROP_METHOD_NAME); } public function getClassName(): string diff --git a/src/Worker/LocatorInterface.php b/src/Worker/LocatorInterface.php index 283a8be3..8bcd5d56 100644 --- a/src/Worker/LocatorInterface.php +++ b/src/Worker/LocatorInterface.php @@ -14,4 +14,6 @@ public function getCallable(): callable; public function getClass(); public function getClassName(): string; + + public function getMethodName(): string; } \ No newline at end of file From 76e2ccb3f54512e9fd8fd532bb1cdb9f4774d655 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Tue, 1 May 2018 09:58:12 -0500 Subject: [PATCH 40/44] logging --- src/Process/Job.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Process/Job.php b/src/Process/Job.php index f569795c..e1128fe4 100644 --- a/src/Process/Job.php +++ b/src/Process/Job.php @@ -30,6 +30,7 @@ protected function _run(): Forked $this->_getMaintainer()->deleteCompletedJobs(); $this->_getForeman()->workWorker(); }catch(\Throwable $throwable){ + $this->_getLogger()->critical($throwable->getMessage()); $this->_setOrReplaceExitCode(255); } From 0616862c7f4627c38abf9599be0ce0c955b9e1f5 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Tue, 1 May 2018 12:16:47 -0500 Subject: [PATCH 41/44] revert counting schedule limit check --- src/Data/Job/Collection/ScheduleLimit.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Data/Job/Collection/ScheduleLimit.php b/src/Data/Job/Collection/ScheduleLimit.php index c6ee336b..abdeee75 100644 --- a/src/Data/Job/Collection/ScheduleLimit.php +++ b/src/Data/Job/Collection/ScheduleLimit.php @@ -65,9 +65,7 @@ protected function _prepareCollection(): Db\Model\CollectionAbstract ->nest() ->equalTo(JobInterface::FIELD_NAME_ASSIGNED_STATE, State\Service::STATE_WORKING) ->or - ->equalTo(JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, State\Service::STATE_WORKING) - ->or - ->equalTo(JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, State\Service::STATE_SCHEDULE_LIMIT_CHECK); + ->equalTo(JobInterface::FIELD_NAME_NEXT_STATE_REQUEST, State\Service::STATE_WORKING); return $this; } From 874056702df10326c6543e72b7cb9929595730d5 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Tue, 1 May 2018 12:36:05 -0500 Subject: [PATCH 42/44] more test data sets --- tests/BehaviorSmokeTest/BehaviorSmokeTest.php | 6 + .../dataSet3/fixtures/1_job_type.yml | 14 + .../dataSet3/fixtures/2_jobs.yml | 1001 +++++++++++++++++ 3 files changed, 1021 insertions(+) create mode 100644 tests/BehaviorSmokeTest/dataSet3/fixtures/1_job_type.yml create mode 100644 tests/BehaviorSmokeTest/dataSet3/fixtures/2_jobs.yml diff --git a/tests/BehaviorSmokeTest/BehaviorSmokeTest.php b/tests/BehaviorSmokeTest/BehaviorSmokeTest.php index a1011a52..3d3b4f95 100644 --- a/tests/BehaviorSmokeTest/BehaviorSmokeTest.php +++ b/tests/BehaviorSmokeTest/BehaviorSmokeTest.php @@ -18,4 +18,10 @@ public function dataSet2(): BehaviorSmokeTest { return $this; } + + /** @test */ + public function dataSet3(): BehaviorSmokeTest + { + return $this; + } } \ No newline at end of file diff --git a/tests/BehaviorSmokeTest/dataSet3/fixtures/1_job_type.yml b/tests/BehaviorSmokeTest/dataSet3/fixtures/1_job_type.yml new file mode 100644 index 00000000..d67e1116 --- /dev/null +++ b/tests/BehaviorSmokeTest/dataSet3/fixtures/1_job_type.yml @@ -0,0 +1,14 @@ +kojo_job_type: + - kojo_job_type_id: '1' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + default_importance: '10' + cron_expression: "* * * * *" + schedule_limit: '10' + schedule_limit_allowance: '1' + is_enabled: '1' + auto_complete_success: '0' + auto_delete_interval_duration: "PT0S" \ No newline at end of file diff --git a/tests/BehaviorSmokeTest/dataSet3/fixtures/2_jobs.yml b/tests/BehaviorSmokeTest/dataSet3/fixtures/2_jobs.yml new file mode 100644 index 00000000..2a0bbb59 --- /dev/null +++ b/tests/BehaviorSmokeTest/dataSet3/fixtures/2_jobs.yml @@ -0,0 +1,1001 @@ +kojo_job: + - kojo_job_id: '2' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:23:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:09:47 + last_transition_micro_time: '1525118987525328' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '3' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:24:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:09:59 + last_transition_micro_time: '1525118999466217' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '4' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:25:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:12:00 + last_transition_micro_time: '1525119120264405' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '5' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:26:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:13:48 + last_transition_micro_time: '1525119228838578' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '6' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:27:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:15:20 + last_transition_micro_time: '1525119320062890' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:22:24 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '7' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:28:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:16:10 + last_transition_micro_time: '1525119370387988' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '8' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:29:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:16:22 + last_transition_micro_time: '1525119382533304' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '9' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:30:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:29:36 + last_transition_micro_time: '1525120176340327' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '10' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:31:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:30:02 + last_transition_micro_time: '1525120202306093' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:26:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '11' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:34:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:47:28 + last_transition_micro_time: '1525121248641458' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '12' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:35:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581630710' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '13' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:36:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581636667' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '14' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:37:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581644111' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '15' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:38:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581651200' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '16' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 19:39:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717855916' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:18 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '17' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '0' + importance: '0' + status_id: + work_at_date_time: 2018-04-30 19:34:54 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581613946' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 19:34:54 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '18' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:09:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717821446' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:09:48 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '19' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:10:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716092219' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:09:48 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '20' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:11:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717867295' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:09:48 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '27' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:18:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718335847' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:13:53 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '29' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:19:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581726975' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:15:21 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '30' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:20:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718446827' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:15:21 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '31' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:21:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718725372' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:16:12 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '32' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:29:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581745361' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:29:39 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '33' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:30:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:18 + last_transition_micro_time: '1525121718255557' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:29:39 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '34' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:31:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716262394' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:29:39 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '38' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:35:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581782410' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:30:04 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '39' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:47:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581787662' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '40' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:48:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581794319' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '41' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:49:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717973651' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '42' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:50:00 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581805940' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '43' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:51:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717778582' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '44' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:52:00 + next_state_request: "none" + assigned_state: "working" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:17 + last_transition_micro_time: '1525121717927648' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:47:32 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '45' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '0' + importance: '0' + status_id: + work_at_date_time: 2018-04-30 20:51:15 + next_state_request: "working" + assigned_state: "waiting" + previous_state: "waiting" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581817620' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:51:15 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '46' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '9' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:53:00 + next_state_request: "working" + assigned_state: "crashed" + previous_state: "working" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716323544' + times_worked: '1' + times_retried: '0' + times_held: '0' + times_crashed: '1' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '49' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:56:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581574489' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '50' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:57:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581580374' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '51' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:58:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:53:01 + last_transition_micro_time: '1525121581586732' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:53:01 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '54' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 20:59:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:54:02 + last_transition_micro_time: '1525121642310586' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:54:02 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' + - kojo_job_id: '63' + type_code: "agent_reviews_update" + name: "Agent Reviews Update" + priority: '10' + importance: '10' + status_id: + work_at_date_time: 2018-04-30 21:00:00 + next_state_request: "schedule_limit_check" + assigned_state: "waiting" + previous_state: "new" + worker_uri: '\Neighborhoods\Kojo\Example\Worker' + worker_method: "work" + can_work_in_parallel: '1' + last_transition_date_time: 2018-04-30 20:55:16 + last_transition_micro_time: '1525121716355175' + times_worked: '0' + times_retried: '0' + times_held: '0' + times_crashed: '0' + times_panicked: '0' + created_at_date_time: 2018-04-30 20:55:16 + completed_at_date_time: + delete_after_date_time: + most_recent_host_name: + most_recent_process_id: '0' \ No newline at end of file From 4c8e45a9d7f57fa279f0f47b8129c53a115f479b Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Tue, 1 May 2018 12:39:00 -0500 Subject: [PATCH 43/44] runtime behavior for root proc - alarm time 60s - max child process 20 --- src/Process/Pool/Factory.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Process/Pool/Factory.yml b/src/Process/Pool/Factory.yml index 2ef29c91..8e0ed7fb 100644 --- a/src/Process/Pool/Factory.yml +++ b/src/Process/Pool/Factory.yml @@ -1,7 +1,7 @@ parameters: - process_pool_strategy.max_child_processes: 10 + process_pool_strategy.max_child_processes: 20 process_pool_strategy.child_process_wait_throttle: 1 - process_pool_strategy.max_alarm_time: 0 + process_pool_strategy.max_alarm_time: 60 process_pool_strategy-server.max_child_processes: 1 process_pool_strategy-server.child_process_wait_throttle: 1 process_pool_strategy-server.max_alarm_time: 0 From 739ec83e9ca5140c24cd86e122d3b821cd894425 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 2 May 2018 16:14:16 -0500 Subject: [PATCH 44/44] KOJO-3 KOJO-2 | bugfixes etc. - update example worker - added environmental parameters to be set by client - set alarm to 5s - set max child processes to 10 - refactored isFull to (isFull and canEnvironmentSustainAdditionProcesses) for testing the state of the environment since that state can (and likely will) change between samples so it causes an unsafe test when combined with addChildProcess - updated tests --- example/Environment/Parameters.yml | 8 +++++++ example/Worker.php | 5 ++++ src/Db/PDO/Builder.yml | 6 ++--- src/Environment/Parameters.yml | 13 ++++++----- src/Process/Pool.php | 23 +++++++++++-------- src/Process/Pool/Factory.yml | 4 ++-- src/Process/Pool/Strategy.php | 12 ++++++---- src/Process/PoolAbstract.php | 14 +++++------ src/Process/PoolInterface.php | 2 ++ src/Redis.yml | 3 --- src/Redis/Factory.yml | 4 ++-- tests/Application/Environment/Parameters.yml | 8 +++++++ .../dataSet1/fixtures/1_job_types.yml | 4 ++-- 13 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 example/Environment/Parameters.yml delete mode 100644 src/Redis.yml create mode 100644 tests/Application/Environment/Parameters.yml diff --git a/example/Environment/Parameters.yml b/example/Environment/Parameters.yml new file mode 100644 index 00000000..ac91cdb2 --- /dev/null +++ b/example/Environment/Parameters.yml @@ -0,0 +1,8 @@ +parameters: + neighborhoods.kojo.environment.parameters.redis_port: '%env(REDIS_PORT)%' + neighborhoods.kojo.environment.parameters.redis_host: '%env(REDIS_HOST)%' + neighborhoods.kojo.environment.parameters.database_user_name: '%env(DATABASE_USERNAME)%' + neighborhoods.kojo.environment.parameters.database_password: '%env(DATABASE_PASSWORD)%' + neighborhoods.kojo.environment.parameters.database_adapter: '%env(DATABASE_ADAPTER)%' + neighborhoods.kojo.environment.parameters.database_host: '%env(DATABASE_HOST)%' + neighborhoods.kojo.environment.parameters.database_name: '%env(DATABASE_NAME)%' \ No newline at end of file diff --git a/example/Worker.php b/example/Worker.php index 1a9113df..eaa697f3 100644 --- a/example/Worker.php +++ b/example/Worker.php @@ -13,6 +13,11 @@ class Worker public function work() { +// $newJobScheduler = $this->_getApiV1WorkerService()->getNewJobScheduler(); +// $newJobScheduler->setJobTypeCode('type_code_1') +// ->setWorkAtDateTime(new \DateTime('now')) +// ->save() +// ->getJobId(); $this->_getApiV1WorkerService()->requestCompleteSuccess()->applyRequest(); return $this; diff --git a/src/Db/PDO/Builder.yml b/src/Db/PDO/Builder.yml index ce277973..1b201947 100644 --- a/src/Db/PDO/Builder.yml +++ b/src/Db/PDO/Builder.yml @@ -4,9 +4,9 @@ services: public: false shared: false calls: - - [setPassword, ['%env(DATABASE_PASSWORD)%']] - - [setUserName, ['%env(DATABASE_USERNAME)%']] - - [setDataSourceName, ['%env(DATABASE_ADAPTER)%:dbname=%env(DATABASE_NAME)%;host=%env(DATABASE_HOST)%']] + - [setPassword, ['%neighborhoods.kojo.environment.parameters.database_password%']] + - [setUserName, ['%neighborhoods.kojo.environment.parameters.database_user_name%']] + - [setDataSourceName, ['%neighborhoods.kojo.environment.parameters.database_adapter%:dbname=%neighborhoods.kojo.environment.parameters.database_name%;host=%neighborhoods.kojo.environment.parameters.database_host%']] db.pdo.builder: alias: neighborhoods.kojo.db.pdo.builder public: false \ No newline at end of file diff --git a/src/Environment/Parameters.yml b/src/Environment/Parameters.yml index 6e8579b3..3b51ba41 100644 --- a/src/Environment/Parameters.yml +++ b/src/Environment/Parameters.yml @@ -1,7 +1,8 @@ parameters: - env(REDIS_PORT): 6379 - env(REDIS_HOST): 'redis' - env(DATABASE_USERNAME): '' - env(DATABASE_PASSWORD): '' - env(DATABASE_ADAPTER): '' - env(DATABASE_HOST): '' \ No newline at end of file + neighborhoods.kojo.environment.parameters.redis_port: + neighborhoods.kojo.environment.parameters.redis_host: + neighborhoods.kojo.environment.parameters.database_user_name: + neighborhoods.kojo.environment.parameters.database_password: + neighborhoods.kojo.environment.parameters.database_adapter: + neighborhoods.kojo.environment.parameters.database_host: + neighborhoods.kojo.environment.parameters.database_name: \ No newline at end of file diff --git a/src/Process/Pool.php b/src/Process/Pool.php index 12d91e81..af21ca65 100644 --- a/src/Process/Pool.php +++ b/src/Process/Pool.php @@ -79,16 +79,21 @@ public function getCountOfChildProcesses(): int public function addChildProcess(ProcessInterface $childProcess): PoolInterface { - $this->_getProcessSignal()->incrementWaitCount(); - if ($this->isFull()) { - throw new \LogicException('Process pool is full.'); - }else { - $childProcess->start(); - $this->_childProcesses[$childProcess->getProcessId()] = $childProcess; - $message = "Forked process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; - $this->_getLogger()->info($message); + try{ + $this->_getProcessSignal()->incrementWaitCount(); + if ($this->isFull()) { + throw new \LogicException('Process pool is full.'); + }else { + $childProcess->start(); + $this->_childProcesses[$childProcess->getProcessId()] = $childProcess; + $message = "Forked process[{$childProcess->getProcessId()}][{$childProcess->getTypeCode()}]."; + $this->_getLogger()->info($message); + } + $this->_getProcessSignal()->decrementWaitCount(); + }catch(\Throwable $throwable){ + $this->_getProcessSignal()->decrementWaitCount(); + throw $throwable; } - $this->_getProcessSignal()->decrementWaitCount(); return $this; } diff --git a/src/Process/Pool/Factory.yml b/src/Process/Pool/Factory.yml index 8e0ed7fb..37f2efcd 100644 --- a/src/Process/Pool/Factory.yml +++ b/src/Process/Pool/Factory.yml @@ -1,7 +1,7 @@ parameters: - process_pool_strategy.max_child_processes: 20 + process_pool_strategy.max_child_processes: 10 process_pool_strategy.child_process_wait_throttle: 1 - process_pool_strategy.max_alarm_time: 60 + process_pool_strategy.max_alarm_time: 5 process_pool_strategy-server.max_child_processes: 1 process_pool_strategy-server.child_process_wait_throttle: 1 process_pool_strategy-server.max_alarm_time: 0 diff --git a/src/Process/Pool/Strategy.php b/src/Process/Pool/Strategy.php index e8306e69..ea2bcfec 100644 --- a/src/Process/Pool/Strategy.php +++ b/src/Process/Pool/Strategy.php @@ -30,7 +30,11 @@ protected function _listenerProcessExited(ListenerInterface $listenerProcess): S if ($listenerProcess->getExitCode() !== 0) { $this->_pauseListenerProcess($listenerProcess); }else { - while (!$this->_getProcessPool()->isFull() && $listenerProcess->hasMessages()) { + while ( + $listenerProcess->hasMessages() + && !$this->_getProcessPool()->isFull() + && $this->_getProcessPool()->canEnvironmentSustainAdditionProcesses() + ) { $listenerProcess->processMessages(); } @@ -67,7 +71,7 @@ public function currentPendingChildExitsCompleted(): StrategyInterface protected function _jobProcessExited(JobInterface $jobProcess): Strategy { $this->_getProcessPool()->freeChildProcess($jobProcess->getProcessId()); - if ($jobProcess->getExitCode() !== 0) { + if ($jobProcess->getExitCode() !== 0 && $this->_getProcessPool()->canEnvironmentSustainAdditionProcesses()) { $typeCode = $jobProcess->getTypeCode(); $replacementProcess = $this->_getProcessCollection()->getProcessPrototypeClone($typeCode); $replacementProcess->setThrottle($this->getChildProcessWaitThrottle()); @@ -82,7 +86,7 @@ protected function _jobProcessExited(JobInterface $jobProcess): Strategy public function receivedAlarm(): StrategyInterface { - if (!$this->_getProcessPool()->isFull()) { + if (!$this->_getProcessPool()->isFull() && $this->_getProcessPool()->canEnvironmentSustainAdditionProcesses()) { if ($this->_hasPausedListenerProcess()) { $this->_unPauseListenerProcesses(); }else { @@ -105,7 +109,7 @@ public function initializePool(): StrategyInterface foreach ($this->_getProcessCollection() as $process) { $this->_getProcessPool()->addChildProcess($process); } - if ($this->_hasFillProcessTypeCode()) { + if ($this->_hasFillProcessTypeCode() && $this->_getProcessPool()->canEnvironmentSustainAdditionProcesses()) { while (!$this->_getProcessPool()->isFull()) { $fillProcessTypeCode = $this->_getFillProcessTypeCode(); $fillProcess = $this->_getProcessCollection()->getProcessPrototypeClone($fillProcessTypeCode); diff --git a/src/Process/PoolAbstract.php b/src/Process/PoolAbstract.php index 55b7fb5e..59e01712 100644 --- a/src/Process/PoolAbstract.php +++ b/src/Process/PoolAbstract.php @@ -43,19 +43,17 @@ public function setAlarm(int $seconds): PoolInterface public function isEmpty(): bool { - return (bool)($this->getCountOfChildProcesses() === 0); + return ($this->getCountOfChildProcesses() === 0); } public function isFull(): bool { - if ((float)current(sys_getloadavg()) > $this->_getProcessPoolStrategy()->getMaximumLoadAverage()) { - $isFull = true; - }else { - $maxChildProcesses = $this->_getProcessPoolStrategy()->getMaxChildProcesses(); - $isFull = (bool)($this->getCountOfChildProcesses() >= $maxChildProcesses); - } + return ($this->getCountOfChildProcesses() >= $this->_getProcessPoolStrategy()->getMaxChildProcesses()); + } - return $isFull; + public function canEnvironmentSustainAdditionProcesses(): bool + { + return ((float)current(sys_getloadavg()) <= $this->_getProcessPoolStrategy()->getMaximumLoadAverage()); } protected function _initialize(): PoolInterface diff --git a/src/Process/PoolInterface.php b/src/Process/PoolInterface.php index 7baca078..6c441e94 100644 --- a/src/Process/PoolInterface.php +++ b/src/Process/PoolInterface.php @@ -36,4 +36,6 @@ public function getCountOfChildProcesses(): int; public function setProcess(ProcessInterface $process); public function getProcess(): ProcessInterface; + + public function canEnvironmentSustainAdditionProcesses(): bool; } \ No newline at end of file diff --git a/src/Redis.yml b/src/Redis.yml deleted file mode 100644 index c8268cbe..00000000 --- a/src/Redis.yml +++ /dev/null @@ -1,3 +0,0 @@ -parameters: - env(REDIS_HOST): 'redis' - env(REDIS_PORT): 6379 \ No newline at end of file diff --git a/src/Redis/Factory.yml b/src/Redis/Factory.yml index 93c8455f..484d0f75 100644 --- a/src/Redis/Factory.yml +++ b/src/Redis/Factory.yml @@ -5,8 +5,8 @@ services: shared: true calls: - [addOption, [!php/const \Redis::OPT_READ_TIMEOUT, '-1']] - - [setHost, ['%env(REDIS_HOST)%']] - - [setPort, ['%env(REDIS_PORT)%']] + - [setHost, ['%neighborhoods.kojo.environment.parameters.redis_host%']] + - [setPort, ['%neighborhoods.kojo.environment.parameters.redis_port%']] redis.factory: alias: neighborhoods.kojo.redis.factory public: false \ No newline at end of file diff --git a/tests/Application/Environment/Parameters.yml b/tests/Application/Environment/Parameters.yml new file mode 100644 index 00000000..ac91cdb2 --- /dev/null +++ b/tests/Application/Environment/Parameters.yml @@ -0,0 +1,8 @@ +parameters: + neighborhoods.kojo.environment.parameters.redis_port: '%env(REDIS_PORT)%' + neighborhoods.kojo.environment.parameters.redis_host: '%env(REDIS_HOST)%' + neighborhoods.kojo.environment.parameters.database_user_name: '%env(DATABASE_USERNAME)%' + neighborhoods.kojo.environment.parameters.database_password: '%env(DATABASE_PASSWORD)%' + neighborhoods.kojo.environment.parameters.database_adapter: '%env(DATABASE_ADAPTER)%' + neighborhoods.kojo.environment.parameters.database_host: '%env(DATABASE_HOST)%' + neighborhoods.kojo.environment.parameters.database_name: '%env(DATABASE_NAME)%' \ No newline at end of file diff --git a/tests/BehaviorSmokeTest/dataSet1/fixtures/1_job_types.yml b/tests/BehaviorSmokeTest/dataSet1/fixtures/1_job_types.yml index e9c0a689..4b175ea2 100644 --- a/tests/BehaviorSmokeTest/dataSet1/fixtures/1_job_types.yml +++ b/tests/BehaviorSmokeTest/dataSet1/fixtures/1_job_types.yml @@ -11,7 +11,7 @@ kojo_job_type: schedule_limit: 0 schedule_limit_allowance: 1 is_enabled: 1 - auto_complete_success: 1 + auto_complete_success: 0 auto_delete_interval_duration: 'PT0S' - kojo_job_type_id: 2 @@ -25,5 +25,5 @@ kojo_job_type: schedule_limit: 3 schedule_limit_allowance: 1 is_enabled: 1 - auto_complete_success: 1 + auto_complete_success: 0 auto_delete_interval_duration: 'PT0S' \ No newline at end of file