Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Commit

Permalink
Added worker TTL and set the default to 3 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Apr 6, 2016
1 parent 44ea6a3 commit ba5abe0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"require": {
"php": "^5.5||^7.0",
"cakephp/cakephp": "^3.0.0",
"wyrihaximus/react-child-process-pool": "^1.0.0",
"wyrihaximus/react-child-process-pool": "^1.3",
"doctrine/annotations": "^1.2",
"phpdocumentor/reflection-docblock": "^2.0|^3.0"
},
Expand Down
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
Configure::write('WyriHaximus.React.Cake.Orm.Process', 'exec php ' . ROOT . '/bin/cake.php WyriHaximus/React/Cake/Orm.worker run -q');
}

if (!Configure::check('WyriHaximus.React.Cake.Orm.TTL')) {
Configure::write('WyriHaximus.React.Cake.Orm.TTL', 3);
}

AnnotationRegistry::registerLoader(function ($class) {
return class_exists($class);
});
2 changes: 2 additions & 0 deletions src/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use React\Promise\PromiseInterface;
use WyriHaximus\React\ChildProcess\Messenger\Messages\Factory;
use WyriHaximus\React\ChildProcess\Pool\Factory\Flexible;
use WyriHaximus\React\ChildProcess\Pool\Options;
use WyriHaximus\React\ChildProcess\Pool\PoolInfoInterface;
use WyriHaximus\React\ChildProcess\Pool\PoolInterface;
use WyriHaximus\React\ChildProcess\Pool\PoolUtilizerInterface;
Expand Down Expand Up @@ -53,6 +54,7 @@ protected function __construct(LoopInterface $loop)
$this->loop,
[
'processOptions' => Configure::read('WyriHaximus.React.Cake.Orm.Line'),
Options::TTL => Configure::read('WyriHaximus.React.Cake.Orm.TTL'),
]
)->then(function (PoolInterface $pool) {
$this->pool = $pool;
Expand Down

0 comments on commit ba5abe0

Please sign in to comment.