-
Notifications
You must be signed in to change notification settings - Fork 3
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 #101 from proophsoftware/feature/event_machine_int…
…erfaces Add interfaces to avoid typehinting Event Machine at runtime
- Loading branch information
Showing
3 changed files
with
55 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/** | ||
* This file is part of the proophsoftware/event-machine. | ||
* (c) 2017-2018 prooph software GmbH <contact@prooph.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\EventMachine\Messaging; | ||
|
||
use React\Promise\Promise; | ||
|
||
interface MessageDispatcher | ||
{ | ||
/** | ||
* @param string|Message $messageOrName | ||
* @param array $payload | ||
* @return null|Promise Promise is returned in case of a Query otherwise return type is null | ||
*/ | ||
public function dispatch($messageOrName, array $payload = []): ?Promise; | ||
} |
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,27 @@ | ||
<?php | ||
/** | ||
* This file is part of the proophsoftware/event-machine. | ||
* (c) 2017-2018 prooph software GmbH <contact@prooph.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\EventMachine\Persistence; | ||
|
||
use Prooph\EventMachine\Aggregate\Exception\AggregateNotFound; | ||
use Prooph\EventMachine\Exception\InvalidArgumentException; | ||
|
||
interface AggregateStateStore | ||
{ | ||
/** | ||
* @param string $aggregateType | ||
* @param string $aggregateId | ||
* @return mixed State of the aggregate | ||
* @throws InvalidArgumentException If $aggregateType is unknown | ||
* @throws AggregateNotFound If aggregate state cannot be found | ||
*/ | ||
public function loadAggregateState(string $aggregateType, string $aggregateId); | ||
} |