-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from neighborhoods/v1-edge-rounding
2.0.0
- Loading branch information
Showing
147 changed files
with
1,818 additions
and
2,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker; | ||
|
||
use Neighborhoods\Kojo\Example\Worker; | ||
use Neighborhoods\Pylon\Data; | ||
|
||
class Delegate implements DelegateInterface | ||
{ | ||
use Data\Property\Defensive\AwareTrait; | ||
use Worker\Queue\Message\AwareTrait; | ||
|
||
public function businessLogic(): DelegateInterface | ||
{ | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\DelegateInterface; | ||
|
||
trait AwareTrait | ||
{ | ||
public function setWorkerDelegate(DelegateInterface $workerDelegate): self | ||
{ | ||
$this->_create(DelegateInterface::class, $workerDelegate); | ||
|
||
return $this; | ||
} | ||
|
||
protected function _getWorkerDelegate(): DelegateInterface | ||
{ | ||
return $this->_read(DelegateInterface::class); | ||
} | ||
|
||
protected function _getWorkerDelegateClone(): DelegateInterface | ||
{ | ||
return clone $this->_getWorkerDelegate(); | ||
} | ||
|
||
protected function _hasWorkerDelegate(): bool | ||
{ | ||
return $this->_exists(DelegateInterface::class); | ||
} | ||
|
||
protected function _unsetWorkerDelegate(): self | ||
{ | ||
$this->_delete(DelegateInterface::class); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\DelegateInterface; | ||
|
||
class Factory implements FactoryInterface | ||
{ | ||
use AwareTrait; | ||
|
||
public function create(): DelegateInterface | ||
{ | ||
$workerDelegate = $this->_getWorkerDelegateClone(); | ||
|
||
return $workerDelegate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate\Factory; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\Delegate\FactoryInterface; | ||
|
||
trait AwareTrait | ||
{ | ||
public function setWorkerDelegateFactory(FactoryInterface $workerDelegateFactory): self | ||
{ | ||
$this->_create(FactoryInterface::class, $workerDelegateFactory); | ||
|
||
return $this; | ||
} | ||
|
||
protected function _getWorkerDelegateFactory(): FactoryInterface | ||
{ | ||
return $this->_read(FactoryInterface::class); | ||
} | ||
|
||
protected function _getWorkerDelegateFactoryClone(): FactoryInterface | ||
{ | ||
return clone $this->_getWorkerDelegateFactory(); | ||
} | ||
|
||
protected function _hasWorkerDelegateFactory(): bool | ||
{ | ||
return $this->_exists(FactoryInterface::class); | ||
} | ||
|
||
protected function _unsetWorkerDelegateFactory(): self | ||
{ | ||
$this->_delete(FactoryInterface::class); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\DelegateInterface; | ||
|
||
interface FactoryInterface | ||
{ | ||
public function create(): DelegateInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\DelegateInterface; | ||
use Neighborhoods\Kojo\Example\Worker; | ||
|
||
class Repository implements RepositoryInterface | ||
{ | ||
use Worker\Delegate\Factory\AwareTrait; | ||
|
||
public function getNewWorkerDelegate(): DelegateInterface | ||
{ | ||
return $this->_getWorkerDelegateFactory()->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate\Repository; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\Delegate\RepositoryInterface; | ||
|
||
trait AwareTrait | ||
{ | ||
public function setWorkerDelegateRepository(RepositoryInterface $workerDelegateRepository): self | ||
{ | ||
$this->_create(RepositoryInterface::class, $workerDelegateRepository); | ||
|
||
return $this; | ||
} | ||
|
||
protected function _getWorkerDelegateRepository(): RepositoryInterface | ||
{ | ||
return $this->_read(RepositoryInterface::class); | ||
} | ||
|
||
protected function _getWorkerDelegateRepositoryClone(): RepositoryInterface | ||
{ | ||
return clone $this->_getWorkerDelegateRepository(); | ||
} | ||
|
||
protected function _hasWorkerDelegateRepository(): bool | ||
{ | ||
return $this->_exists(RepositoryInterface::class); | ||
} | ||
|
||
protected function _unsetWorkerDelegateRepository(): self | ||
{ | ||
$this->_delete(RepositoryInterface::class); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker\Delegate; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\DelegateInterface; | ||
|
||
interface RepositoryInterface | ||
{ | ||
public function getNewWorkerDelegate(): DelegateInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker; | ||
|
||
use Neighborhoods\Kojo\Example\Worker\Queue\MessageInterface; | ||
|
||
interface DelegateInterface | ||
{ | ||
public function setWorkerQueueMessage(MessageInterface $workerQueueMessage); | ||
|
||
public function businessLogic(): DelegateInterface; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neighborhoods\Kojo\Example\Worker; | ||
|
||
use Neighborhoods\Kojo\Example\Worker; | ||
use Neighborhoods\Kojo\Example\Worker\Queue\MessageInterface; | ||
|
||
class Queue implements QueueInterface | ||
{ | ||
use Worker\Queue\Message\AwareTrait; | ||
|
||
public function getNextMessage(): MessageInterface | ||
{ | ||
return $this->_getWorkerQueueMessageClone(); | ||
} | ||
|
||
public function waitForNextMessage(): QueueInterface | ||
{ | ||
sleep(random_int(0, 10)); | ||
|
||
return $this; | ||
} | ||
|
||
public function hasNextMessage(): bool | ||
{ | ||
return (random_int(0, 5) === 5); | ||
} | ||
} |
Oops, something went wrong.