diff --git a/composer.json b/composer.json index 22ef0037..b95474ab 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,8 @@ "amphp/byte-stream": "^1.5.1", "amphp/file": "^0.3.3", "amphp/socket": "^0.10.11", - "prooph/event-store": "dev-master", + "prooph/event-store": "dev-async", + "prooph/php-cs-fixer-config": "^0.3", "ramsey/uuid": "^3.8" }, "require-dev": { diff --git a/examples/demo-persistent-subscription-with-dns-cluster.php b/examples/demo-persistent-subscription-with-dns-cluster.php index 74609aa8..e9299f1b 100644 --- a/examples/demo-persistent-subscription-with-dns-cluster.php +++ b/examples/demo-persistent-subscription-with-dns-cluster.php @@ -16,9 +16,9 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\Exception\InvalidOperationException; use Prooph\EventStore\Internal\PersistentSubscriptionCreateResult; use Prooph\EventStore\PersistentSubscriptionSettings; @@ -76,9 +76,9 @@ yield $connection->connectToPersistentSubscriptionAsync( 'foo-bar', 'test-persistent-subscription', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { @@ -88,9 +88,9 @@ public function __invoke( return new Success(); } }, - new class() implements AsyncPersistentSubscriptionDropped { + new class() implements PersistentSubscriptionDropped { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/examples/demo-persistent-subscription.php b/examples/demo-persistent-subscription.php index bbb965b0..fc32a477 100644 --- a/examples/demo-persistent-subscription.php +++ b/examples/demo-persistent-subscription.php @@ -16,10 +16,10 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; use Prooph\EventStore\Exception\InvalidOperationException; use Prooph\EventStore\Internal\PersistentSubscriptionCreateResult; use Prooph\EventStore\PersistentSubscriptionSettings; @@ -69,9 +69,9 @@ yield $connection->connectToPersistentSubscriptionAsync( 'foo-bar', 'test-persistent-subscription', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { @@ -81,9 +81,9 @@ public function __invoke( return new Success(); } }, - new class() implements AsyncPersistentSubscriptionDropped { + new class() implements PersistentSubscriptionDropped { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/examples/demo-subscribe-to-all-from.php b/examples/demo-subscribe-to-all-from.php index 352dc88b..4cb1c1fb 100644 --- a/examples/demo-subscribe-to-all-from.php +++ b/examples/demo-subscribe-to-all-from.php @@ -16,12 +16,12 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropReason; use Prooph\EventStore\UserCredentials; @@ -47,9 +47,9 @@ yield $connection->subscribeToAllFromAsync( null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncCatchupSubscription { + new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent): Promise { echo 'incoming event: ' . $resolvedEvent->originalEventNumber() . '@' . $resolvedEvent->originalStreamName() . PHP_EOL; @@ -58,15 +58,15 @@ public function __invoke( return new Success(); } }, - new class() implements LiveProcessingStartedOnAsyncCatchUpSubscription { - public function __invoke(AsyncEventStoreCatchUpSubscription $subscription): void + new class() implements LiveProcessingStartedOnCatchUpSubscription { + public function __invoke(EventStoreCatchUpSubscription $subscription): void { echo 'liveProcessingStarted on ' . PHP_EOL; } }, - new class() implements AsyncCatchUpSubscriptionDropped { + new class() implements CatchUpSubscriptionDropped { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/examples/demo-subscribe-to-all.php b/examples/demo-subscribe-to-all.php index 2bd4f3ec..0fa12385 100644 --- a/examples/demo-subscribe-to-all.php +++ b/examples/demo-subscribe-to-all.php @@ -16,8 +16,8 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; +use Prooph\EventStore\Async\EventAppearedOnSubscription; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropped; @@ -45,7 +45,7 @@ $subscription = yield $connection->subscribeToAllAsync( true, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent): Promise diff --git a/examples/demo-subscribe-to-stream-from-with-logger.php b/examples/demo-subscribe-to-stream-from-with-logger.php index 61b8060b..758d363b 100644 --- a/examples/demo-subscribe-to-stream-from-with-logger.php +++ b/examples/demo-subscribe-to-stream-from-with-logger.php @@ -16,11 +16,12 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; +use Prooph\EventStore\CatchUpSubscriptionSettings; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventStoreSubscription; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropped; use Prooph\EventStore\SubscriptionDropReason; @@ -52,7 +53,7 @@ 'foo-bar', null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent): Promise @@ -63,8 +64,8 @@ public function __invoke( return new Success(); } }, - new class() implements LiveProcessingStartedOnAsyncCatchUpSubscription { - public function __invoke(AsyncEventStoreCatchUpSubscription $subscription): void + new class() implements LiveProcessingStartedOnCatchUpSubscription { + public function __invoke(EventStoreCatchUpSubscription $subscription): void { echo 'liveProcessingStarted on ' . $subscription->streamId() . PHP_EOL; } diff --git a/examples/demo-subscribe-to-stream-from.php b/examples/demo-subscribe-to-stream-from.php index 3ee267e7..23f501c0 100644 --- a/examples/demo-subscribe-to-stream-from.php +++ b/examples/demo-subscribe-to-stream-from.php @@ -16,12 +16,12 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropReason; use Throwable; @@ -47,9 +47,9 @@ 'foo-bar', null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncCatchupSubscription { + new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { echo 'incoming event: ' . $resolvedEvent->originalEventNumber() . '@' . $resolvedEvent->originalStreamName() . PHP_EOL; @@ -58,15 +58,15 @@ public function __invoke( return new Success(); } }, - new class() implements LiveProcessingStartedOnAsyncCatchUpSubscription { - public function __invoke(AsyncEventStoreCatchUpSubscription $subscription): void + new class() implements LiveProcessingStartedOnCatchUpSubscription { + public function __invoke(EventStoreCatchUpSubscription $subscription): void { echo 'liveProcessingStarted on ' . $subscription->streamId() . PHP_EOL; } }, - new class() implements AsyncCatchUpSubscriptionDropped { + new class() implements CatchUpSubscriptionDropped { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/examples/demo-subscribe-to-stream.php b/examples/demo-subscribe-to-stream.php index 119e6171..f7d3c3e1 100644 --- a/examples/demo-subscribe-to-stream.php +++ b/examples/demo-subscribe-to-stream.php @@ -16,8 +16,8 @@ use Amp\Loop; use Amp\Promise; use Amp\Success; +use Prooph\EventStore\Async\EventAppearedOnSubscription; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropped; @@ -46,7 +46,7 @@ $subscription = yield $connection->subscribeToStreamAsync( 'foo-bar', true, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent): Promise diff --git a/src/ClientOperations/StartTransactionOperation.php b/src/ClientOperations/StartTransactionOperation.php index 390c996c..1a425a25 100644 --- a/src/ClientOperations/StartTransactionOperation.php +++ b/src/ClientOperations/StartTransactionOperation.php @@ -14,13 +14,13 @@ namespace Prooph\EventStoreClient\ClientOperations; use Amp\Deferred; -use Prooph\EventStore\AsyncEventStoreTransaction; +use Prooph\EventStore\Async\EventStoreTransaction; +use Prooph\EventStore\Async\Internal\EventStoreTransactionConnection; use Prooph\EventStore\Exception\AccessDenied; use Prooph\EventStore\Exception\InvalidTransaction; use Prooph\EventStore\Exception\StreamDeleted; use Prooph\EventStore\Exception\UnexpectedOperationResult; use Prooph\EventStore\Exception\WrongExpectedVersion; -use Prooph\EventStore\Internal\AsyncEventStoreTransactionConnection; use Prooph\EventStore\UserCredentials; use Prooph\EventStoreClient\Messages\ClientMessages\OperationResult; use Prooph\EventStoreClient\Messages\ClientMessages\TransactionStart; @@ -40,7 +40,7 @@ class StartTransactionOperation extends AbstractOperation private $stream; /** @var int */ private $expectedVersion; - /** @var AsyncEventStoreTransactionConnection */ + /** @var EventStoreTransactionConnection */ protected $parentConnection; public function __construct( @@ -49,7 +49,7 @@ public function __construct( bool $requireMaster, string $stream, int $expectedVersion, - AsyncEventStoreTransactionConnection $parentConnection, + EventStoreTransactionConnection $parentConnection, ?UserCredentials $userCredentials ) { $this->requireMaster = $requireMaster; @@ -116,11 +116,11 @@ protected function inspectResponse(ProtobufMessage $response): InspectionResult } } - protected function transformResponse(ProtobufMessage $response): AsyncEventStoreTransaction + protected function transformResponse(ProtobufMessage $response): EventStoreTransaction { \assert($response instanceof TransactionStartCompleted); - return new AsyncEventStoreTransaction( + return new EventStoreTransaction( $response->getTransactionId(), $this->credentials, $this->parentConnection diff --git a/src/EventStoreConnectionFactory.php b/src/EventStoreConnectionFactory.php index f2e8a4e9..fa0bb14c 100644 --- a/src/EventStoreConnectionFactory.php +++ b/src/EventStoreConnectionFactory.php @@ -13,7 +13,7 @@ namespace Prooph\EventStoreClient; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EndPoint; use Prooph\EventStore\Exception\InvalidArgumentException; use Prooph\EventStoreClient\Internal\ClusterDnsEndPointDiscoverer; @@ -27,7 +27,7 @@ public static function createFromConnectionString( string $connectionString, ?ConnectionSettings $settings = null, ?string $connectionName = null - ): AsyncEventStoreConnection { + ): EventStoreConnection { $settings = ConnectionString::getConnectionSettings( $connectionString, $settings ?? ConnectionSettings::default() @@ -54,7 +54,7 @@ public static function createFromUri( ?Uri $uri, ?ConnectionSettings $connectionSettings = null, ?string $connectionName = null - ): AsyncEventStoreConnection { + ): EventStoreConnection { $connectionSettings = $connectionSettings ?? ConnectionSettings::default(); if (null !== $uri) { @@ -170,7 +170,7 @@ public static function createFromEndPoint( EndPoint $endPoint, ?ConnectionSettings $settings = null, ?string $connectionName = null - ): AsyncEventStoreConnection { + ): EventStoreConnection { $settings = $settings ?? ConnectionSettings::default(); return new EventStoreNodeConnection( @@ -187,7 +187,7 @@ public static function createFromEndPoint( public static function createFromSettings( ConnectionSettings $settings, ?string $connectionName = null - ): AsyncEventStoreConnection { + ): EventStoreConnection { return self::createFromUri(null, $settings, $connectionName); } @@ -195,7 +195,7 @@ public static function createFromClusterSettings( ConnectionSettings $connectionSettings, ClusterSettings $clusterSettings, string $connectionName = '' - ): AsyncEventStoreConnection { + ): EventStoreConnection { $endPointDiscoverer = new ClusterDnsEndPointDiscoverer( $connectionSettings->log(), $clusterSettings->clusterDns(), diff --git a/src/Internal/EventStoreAllCatchUpSubscription.php b/src/Internal/EventStoreAllCatchUpSubscription.php index ced49a7c..2db709fb 100644 --- a/src/Internal/EventStoreAllCatchUpSubscription.php +++ b/src/Internal/EventStoreAllCatchUpSubscription.php @@ -17,12 +17,12 @@ use Amp\Delayed; use Amp\Promise; use Prooph\EventStore\AllEventsSlice; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreAllCatchUpSubscription; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventStoreAllCatchUpSubscription as AsyncEventStoreAllCatchUpSubscription; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\Position; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropReason; @@ -41,13 +41,13 @@ class EventStoreAllCatchUpSubscription extends EventStoreCatchUpSubscription imp * @internal */ public function __construct( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, Logger $logger, ?Position $fromPositionExclusive, // if null from the very beginning ?UserCredentials $userCredentials, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted, + ?CatchUpSubscriptionDropped $subscriptionDropped, CatchUpSubscriptionSettings $settings ) { parent::__construct( @@ -71,7 +71,7 @@ public function lastProcessedPosition(): Position } protected function readEventsTillAsync( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, bool $resolveLinkTos, ?UserCredentials $userCredentials, ?int $lastCommitPosition, @@ -81,7 +81,7 @@ protected function readEventsTillAsync( } private function readEventsInternalAsync( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, bool $resolveLinkTos, ?UserCredentials $userCredentials, ?int $lastCommitPosition diff --git a/src/Internal/EventStoreCatchUpSubscription.php b/src/Internal/EventStoreCatchUpSubscription.php index e05f4ef9..72f7b475 100644 --- a/src/Internal/EventStoreCatchUpSubscription.php +++ b/src/Internal/EventStoreCatchUpSubscription.php @@ -19,17 +19,17 @@ use Amp\Success; use Closure; use Generator; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\ClientConnectionEventArgs; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription as AsyncEventStoreCatchUpSubscription; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\ClientConnectionEventArgs; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\Internal\DropData; use Prooph\EventStore\ListenerHandler; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropped; use Prooph\EventStore\SubscriptionDropReason; @@ -53,7 +53,7 @@ abstract class EventStoreCatchUpSubscription implements AsyncEventStoreCatchUpSu /** @var Logger */ protected $log; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $connection; /** @var bool */ private $resolveLinkTos; @@ -65,11 +65,11 @@ abstract class EventStoreCatchUpSubscription implements AsyncEventStoreCatchUpSu /** @var int */ protected $maxPushQueueSize; - /** @var EventAppearedOnAsyncCatchupSubscription */ + /** @var EventAppearedOnCatchupSubscription */ protected $eventAppeared; - /** @var LiveProcessingStartedOnAsyncCatchUpSubscription|null */ + /** @var LiveProcessingStartedOnCatchUpSubscription|null */ private $liveProcessingStarted; - /** @var AsyncCatchUpSubscriptionDropped|null */ + /** @var CatchUpSubscriptionDropped|null */ private $subscriptionDropped; /** @var bool */ @@ -97,13 +97,13 @@ abstract class EventStoreCatchUpSubscription implements AsyncEventStoreCatchUpSu /** @internal */ public function __construct( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, Logger $logger, string $streamId, ?UserCredentials $userCredentials, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted, + ?CatchUpSubscriptionDropped $subscriptionDropped, CatchUpSubscriptionSettings $settings ) { if (null === self::$dropSubscriptionEvent) { @@ -145,7 +145,7 @@ public function subscriptionName(): string } abstract protected function readEventsTillAsync( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, bool $resolveLinkTos, ?UserCredentials $userCredentials, ?int $lastCommitPosition, @@ -279,7 +279,7 @@ private function subscribeToStreamAsync(): Promise )); } - $eventAppeared = new class(Closure::fromCallable([$this, 'enqueuePushedEvent'])) implements EventAppearedOnAsyncSubscription { + $eventAppeared = new class(Closure::fromCallable([$this, 'enqueuePushedEvent'])) implements EventAppearedOnSubscription { private $callback; public function __construct(callable $callback) diff --git a/src/Internal/EventStoreConnectionLogicHandler.php b/src/Internal/EventStoreConnectionLogicHandler.php index a52bb6f2..54919482 100644 --- a/src/Internal/EventStoreConnectionLogicHandler.php +++ b/src/Internal/EventStoreConnectionLogicHandler.php @@ -17,19 +17,19 @@ use Amp\Loop; use Exception; use Generator; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\ClientAuthenticationFailedEventArgs; -use Prooph\EventStore\ClientClosedEventArgs; -use Prooph\EventStore\ClientConnectionEventArgs; -use Prooph\EventStore\ClientErrorEventArgs; -use Prooph\EventStore\ClientReconnectingEventArgs; +use Prooph\EventStore\Async\ClientAuthenticationFailedEventArgs; +use Prooph\EventStore\Async\ClientClosedEventArgs; +use Prooph\EventStore\Async\ClientConnectionEventArgs; +use Prooph\EventStore\Async\ClientErrorEventArgs; +use Prooph\EventStore\Async\ClientReconnectingEventArgs; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\Internal\EventHandler; use Prooph\EventStore\EndPoint; use Prooph\EventStore\Exception\CannotEstablishConnection; use Prooph\EventStore\Exception\EventStoreConnectionException; use Prooph\EventStore\Exception\InvalidOperationException; use Prooph\EventStore\Exception\ObjectDisposed; use Prooph\EventStore\Internal\Consts; -use Prooph\EventStore\Internal\EventHandler; use Prooph\EventStore\ListenerHandler; use Prooph\EventStore\Util\Guid; use Prooph\EventStoreClient\ClientOperations\ClientOperation; @@ -60,7 +60,7 @@ class EventStoreConnectionLogicHandler { private const CLIENT_VERSION = 1; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $esConnection; /** @var TcpPackageConnection|null */ private $connection; @@ -100,7 +100,7 @@ class EventStoreConnectionLogicHandler /** @var int */ private $lastTimeoutsTimeStamp; - public function __construct(AsyncEventStoreConnection $connection, ConnectionSettings $settings) + public function __construct(EventStoreConnection $connection, ConnectionSettings $settings) { $this->esConnection = $connection; $this->settings = $settings; diff --git a/src/Internal/EventStoreNodeConnection.php b/src/Internal/EventStoreNodeConnection.php index a7ece9d0..23085f59 100644 --- a/src/Internal/EventStoreNodeConnection.php +++ b/src/Internal/EventStoreNodeConnection.php @@ -15,16 +15,18 @@ use Amp\Deferred; use Amp\Promise; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\AsyncEventStoreTransaction; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\EventStoreTransaction; +use Prooph\EventStore\Async\Internal\EventStoreTransactionConnection; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\CatchUpSubscriptionSettings; use Prooph\EventStore\Common\SystemEventTypes; use Prooph\EventStore\Common\SystemStreams; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventReadResult; use Prooph\EventStore\EventReadStatus; @@ -34,10 +36,8 @@ use Prooph\EventStore\Exception\OutOfRangeException; use Prooph\EventStore\Exception\UnexpectedValueException; use Prooph\EventStore\ExpectedVersion; -use Prooph\EventStore\Internal\AsyncEventStoreTransactionConnection; use Prooph\EventStore\Internal\Consts; use Prooph\EventStore\ListenerHandler; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\PersistentSubscriptionSettings; use Prooph\EventStore\Position; use Prooph\EventStore\RawStreamMetadataResult; @@ -72,8 +72,8 @@ use Throwable; final class EventStoreNodeConnection implements - AsyncEventStoreConnection, - AsyncEventStoreTransactionConnection + EventStoreConnection, + EventStoreTransactionConnection { /** @var string */ private $connectionName; @@ -641,7 +641,7 @@ public function deletePersistentSubscriptionAsync( public function subscribeToStreamAsync( string $stream, bool $resolveLinkTos, - EventAppearedOnAsyncSubscription $eventAppeared, + EventAppearedOnSubscription $eventAppeared, ?SubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { @@ -670,9 +670,9 @@ public function subscribeToStreamFromAsync( string $stream, ?int $lastCheckpoint, ?CatchUpSubscriptionSettings $settings, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted = null, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted = null, + ?CatchUpSubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { if (empty($stream)) { @@ -703,7 +703,7 @@ public function subscribeToStreamFromAsync( /** {@inheritdoc} */ public function subscribeToAllAsync( bool $resolveLinkTos, - EventAppearedOnAsyncSubscription $eventAppeared, + EventAppearedOnSubscription $eventAppeared, ?SubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { @@ -726,9 +726,9 @@ public function subscribeToAllAsync( public function subscribeToAllFromAsync( ?Position $lastCheckpoint, ?CatchUpSubscriptionSettings $settings, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted = null, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted = null, + ?CatchUpSubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { if (null === $settings) { @@ -755,8 +755,8 @@ public function subscribeToAllFromAsync( public function connectToPersistentSubscriptionAsync( string $stream, string $groupName, - EventAppearedOnAsyncPersistentSubscription $eventAppeared, - ?AsyncPersistentSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnPersistentSubscription $eventAppeared, + ?PersistentSubscriptionDropped $subscriptionDropped = null, int $bufferSize = 10, bool $autoAck = true, ?UserCredentials $userCredentials = null @@ -813,16 +813,16 @@ public function startTransactionAsync( public function continueTransaction( int $transactionId, ?UserCredentials $userCredentials = null - ): AsyncEventStoreTransaction { + ): EventStoreTransaction { if ($transactionId < 0) { throw new InvalidArgumentException('Invalid transaction id'); } - return new AsyncEventStoreTransaction($transactionId, $userCredentials, $this); + return new EventStoreTransaction($transactionId, $userCredentials, $this); } public function transactionalWriteAsync( - AsyncEventStoreTransaction $transaction, + EventStoreTransaction $transaction, array $events, ?UserCredentials $userCredentials ): Promise { @@ -841,7 +841,7 @@ public function transactionalWriteAsync( } public function commitTransactionAsync( - AsyncEventStoreTransaction $transaction, + EventStoreTransaction $transaction, ?UserCredentials $userCredentials ): Promise { $deferred = new Deferred(); diff --git a/src/Internal/EventStorePersistentSubscription.php b/src/Internal/EventStorePersistentSubscription.php index 5e8e1cb9..9c185ccf 100644 --- a/src/Internal/EventStorePersistentSubscription.php +++ b/src/Internal/EventStorePersistentSubscription.php @@ -20,9 +20,9 @@ use Amp\Promise; use Amp\Success; use Generator; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription as AsyncEventStorePersistentSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\EventId; use Prooph\EventStore\Exception\RuntimeException; use Prooph\EventStore\Internal\DropData; @@ -86,8 +86,8 @@ class EventStorePersistentSubscription implements AsyncEventStorePersistentSubsc public function __construct( string $subscriptionId, string $streamId, - EventAppearedOnAsyncPersistentSubscription $eventAppeared, - ?AsyncPersistentSubscriptionDropped $subscriptionDropped, + EventAppearedOnPersistentSubscription $eventAppeared, + ?PersistentSubscriptionDropped $subscriptionDropped, ?UserCredentials $userCredentials, Logger $logger, bool $verboseLogging, diff --git a/src/Internal/EventStoreStreamCatchUpSubscription.php b/src/Internal/EventStoreStreamCatchUpSubscription.php index 8ebc807a..f827347d 100644 --- a/src/Internal/EventStoreStreamCatchUpSubscription.php +++ b/src/Internal/EventStoreStreamCatchUpSubscription.php @@ -17,14 +17,14 @@ use Amp\Delayed; use Amp\Promise; use Generator; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\AsyncEventStoreStreamCatchUpSubscription; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\EventStoreStreamCatchUpSubscription as AsyncEventStoreStreamCatchUpSubscription; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; use Prooph\EventStore\Exception\OutOfRangeException; use Prooph\EventStore\Exception\StreamDeleted; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SliceReadStatus; use Prooph\EventStore\StreamEventsSlice; @@ -44,14 +44,14 @@ class EventStoreStreamCatchUpSubscription extends EventStoreCatchUpSubscription * @internal */ public function __construct( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, Logger $logger, string $streamId, ?int $fromEventNumberExclusive, // if null from the very beginning ?UserCredentials $userCredentials, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted, + ?CatchUpSubscriptionDropped $subscriptionDropped, CatchUpSubscriptionSettings $settings ) { parent::__construct( @@ -76,7 +76,7 @@ public function lastProcessedEventNumber(): int /** @return Promise */ protected function readEventsTillAsync( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, bool $resolveLinkTos, ?UserCredentials $userCredentials, ?int $lastCommitPosition, @@ -87,7 +87,7 @@ protected function readEventsTillAsync( /** @return Promise */ private function readEventsInternalAsync( - AsyncEventStoreConnection $connection, + EventStoreConnection $connection, bool $resolveLinkTos, ?UserCredentials $userCredentials, ?int $lastEventNumber diff --git a/src/Internal/Message/StartSubscriptionMessage.php b/src/Internal/Message/StartSubscriptionMessage.php index 07558fb7..b33af2ca 100644 --- a/src/Internal/Message/StartSubscriptionMessage.php +++ b/src/Internal/Message/StartSubscriptionMessage.php @@ -14,7 +14,7 @@ namespace Prooph\EventStoreClient\Internal\Message; use Amp\Deferred; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; use Prooph\EventStore\SubscriptionDropped; use Prooph\EventStore\UserCredentials; @@ -29,7 +29,7 @@ class StartSubscriptionMessage implements Message private $resolveTo; /** @var UserCredentials|null */ private $userCredentials; - /** @var EventAppearedOnAsyncSubscription */ + /** @var EventAppearedOnSubscription */ private $eventAppeared; /** @var SubscriptionDropped|null */ private $subscriptionDropped; @@ -43,7 +43,7 @@ public function __construct( string $streamId, bool $resolveTo, ?UserCredentials $userCredentials, - EventAppearedOnAsyncSubscription $eventAppeared, + EventAppearedOnSubscription $eventAppeared, ?SubscriptionDropped $subscriptionDropped, int $maxRetries, int $timeout @@ -78,7 +78,7 @@ public function userCredentials(): ?UserCredentials return $this->userCredentials; } - public function eventAppeared(): EventAppearedOnAsyncSubscription + public function eventAppeared(): EventAppearedOnSubscription { return $this->eventAppeared; } diff --git a/src/PersistentSubscriptions/PersistentSubscriptionsManager.php b/src/PersistentSubscriptions/PersistentSubscriptionsManager.php index 5a5951f2..aa55d8cf 100644 --- a/src/PersistentSubscriptions/PersistentSubscriptionsManager.php +++ b/src/PersistentSubscriptions/PersistentSubscriptionsManager.php @@ -14,9 +14,9 @@ namespace Prooph\EventStoreClient\PersistentSubscriptions; use Amp\Promise; +use Prooph\EventStore\Async\PersistentSubscriptions\PersistentSubscriptionsManager as AsyncPersistentSubscriptionsManager; use Prooph\EventStore\EndPoint; use Prooph\EventStore\Exception\InvalidArgumentException; -use Prooph\EventStore\PersistentSubscriptions\AsyncPersistentSubscriptionsManager; use Prooph\EventStore\PersistentSubscriptions\PersistentSubscriptionDetails; use Prooph\EventStore\Transport\Http\EndpointExtensions; use Prooph\EventStore\UserCredentials; diff --git a/src/Projections/ProjectionsManager.php b/src/Projections/ProjectionsManager.php index 646dab58..43062bc0 100644 --- a/src/Projections/ProjectionsManager.php +++ b/src/Projections/ProjectionsManager.php @@ -14,9 +14,9 @@ namespace Prooph\EventStoreClient\Projections; use Amp\Promise; +use Prooph\EventStore\Async\Projections\ProjectionsManager as AsyncProjectionsManager; use Prooph\EventStore\EndPoint; use Prooph\EventStore\Exception\InvalidArgumentException; -use Prooph\EventStore\Projections\AsyncProjectionsManager; use Prooph\EventStore\Projections\ProjectionDetails; use Prooph\EventStore\Transport\Http\EndpointExtensions; use Prooph\EventStore\UserCredentials; diff --git a/src/Projections/QueryManager.php b/src/Projections/QueryManager.php index 2749c4f3..e4eda925 100644 --- a/src/Projections/QueryManager.php +++ b/src/Projections/QueryManager.php @@ -17,8 +17,8 @@ use Amp\Delayed; use Amp\Promise; use Generator; +use Prooph\EventStore\Async\Projections\QueryManager as AsyncQueryManager; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\Projections\AsyncQueryManager; use Prooph\EventStore\Transport\Http\EndpointExtensions; use Prooph\EventStore\UserCredentials; diff --git a/src/UserManagement/UsersManager.php b/src/UserManagement/UsersManager.php index b32eda85..e5325ff3 100644 --- a/src/UserManagement/UsersManager.php +++ b/src/UserManagement/UsersManager.php @@ -14,11 +14,11 @@ namespace Prooph\EventStoreClient\UserManagement; use Amp\Promise; +use Prooph\EventStore\Async\UserManagement\UsersManager as AsyncUsersManager; use Prooph\EventStore\EndPoint; use Prooph\EventStore\Exception\InvalidArgumentException; use Prooph\EventStore\Transport\Http\EndpointExtensions; use Prooph\EventStore\UserCredentials; -use Prooph\EventStore\UserManagement\AsyncUsersManager; use Prooph\EventStore\UserManagement\ChangePasswordDetails; use Prooph\EventStore\UserManagement\ResetPasswordDetails; use Prooph\EventStore\UserManagement\UserCreationInformation; diff --git a/tests/FakeEventStoreConnection.php b/tests/FakeEventStoreConnection.php index b6b48a2b..33eba80e 100644 --- a/tests/FakeEventStoreConnection.php +++ b/tests/FakeEventStoreConnection.php @@ -15,23 +15,23 @@ use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncEventStoreTransaction; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\ClientAuthenticationFailedEventArgs; +use Prooph\EventStore\Async\ClientClosedEventArgs; +use Prooph\EventStore\Async\ClientConnectionEventArgs; +use Prooph\EventStore\Async\ClientErrorEventArgs; +use Prooph\EventStore\Async\ClientReconnectingEventArgs; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\EventStorePersistentSubscription; +use Prooph\EventStore\Async\EventStoreTransaction; +use Prooph\EventStore\Async\Internal\EventHandler; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\ClientAuthenticationFailedEventArgs; -use Prooph\EventStore\ClientClosedEventArgs; -use Prooph\EventStore\ClientConnectionEventArgs; -use Prooph\EventStore\ClientErrorEventArgs; -use Prooph\EventStore\ClientReconnectingEventArgs; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; -use Prooph\EventStore\Internal\EventHandler; use Prooph\EventStore\ListenerHandler; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\PersistentSubscriptionSettings; use Prooph\EventStore\Position; use Prooph\EventStore\StreamMetadata; @@ -42,7 +42,7 @@ use Prooph\EventStoreClient\ConnectionSettings; /** @internal */ -class FakeEventStoreConnection implements AsyncEventStoreConnection +class FakeEventStoreConnection implements EventStoreConnection { /** @var callable */ private $readAllEventsForwardAsync; @@ -218,7 +218,7 @@ public function startTransactionAsync( public function continueTransaction( int $transactionId, ?UserCredentials $userCredentials = null - ): AsyncEventStoreTransaction { + ): EventStoreTransaction { throw new \RuntimeException('Not implemented'); } @@ -251,7 +251,7 @@ public function deletePersistentSubscriptionAsync( public function subscribeToStreamAsync( string $stream, bool $resolveLinkTos, - EventAppearedOnAsyncSubscription $eventAppeared, + EventAppearedOnSubscription $eventAppeared, ?SubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { @@ -267,9 +267,9 @@ public function subscribeToStreamFromAsync( string $stream, ?int $lastCheckpoint, ?CatchUpSubscriptionSettings $settings, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted = null, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted = null, + ?CatchUpSubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { throw new \RuntimeException('Not implemented'); @@ -277,7 +277,7 @@ public function subscribeToStreamFromAsync( public function subscribeToAllAsync( bool $resolveLinkTos, - EventAppearedOnAsyncSubscription $eventAppeared, + EventAppearedOnSubscription $eventAppeared, ?SubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { @@ -292,9 +292,9 @@ public function subscribeToAllAsync( public function subscribeToAllFromAsync( ?Position $lastCheckpoint, ?CatchUpSubscriptionSettings $settings, - EventAppearedOnAsyncCatchupSubscription $eventAppeared, - ?LiveProcessingStartedOnAsyncCatchUpSubscription $liveProcessingStarted = null, - ?AsyncCatchUpSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnCatchupSubscription $eventAppeared, + ?LiveProcessingStartedOnCatchUpSubscription $liveProcessingStarted = null, + ?CatchUpSubscriptionDropped $subscriptionDropped = null, ?UserCredentials $userCredentials = null ): Promise { throw new \RuntimeException('Not implemented'); @@ -303,20 +303,20 @@ public function subscribeToAllFromAsync( public function connectToPersistentSubscription( string $stream, string $groupName, - EventAppearedOnAsyncPersistentSubscription $eventAppeared, - ?AsyncPersistentSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnPersistentSubscription $eventAppeared, + ?PersistentSubscriptionDropped $subscriptionDropped = null, int $bufferSize = 10, bool $autoAck = true, ?UserCredentials $userCredentials = null - ): AsyncEventStorePersistentSubscription { + ): EventStorePersistentSubscription { throw new \RuntimeException('Not implemented'); } public function connectToPersistentSubscriptionAsync( string $stream, string $groupName, - EventAppearedOnAsyncPersistentSubscription $eventAppeared, - ?AsyncPersistentSubscriptionDropped $subscriptionDropped = null, + EventAppearedOnPersistentSubscription $eventAppeared, + ?PersistentSubscriptionDropped $subscriptionDropped = null, int $bufferSize = 10, bool $autoAck = true, ?UserCredentials $userCredentials = null diff --git a/tests/Helper/EventsStream.php b/tests/Helper/EventsStream.php index 6fa4972f..6430f3cb 100644 --- a/tests/Helper/EventsStream.php +++ b/tests/Helper/EventsStream.php @@ -16,7 +16,7 @@ use function Amp\call; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\StreamEventsSlice; /** @internal */ @@ -25,7 +25,7 @@ class EventsStream private const SLICE_SIZE = 10; /** @return Promise */ - public static function count(AsyncEventStoreConnection $connection, string $stream): Promise + public static function count(EventStoreConnection $connection, string $stream): Promise { return call(function () use ($connection, $stream) { $result = 0; diff --git a/tests/Helper/OngoingTransaction.php b/tests/Helper/OngoingTransaction.php index baf85bad..ea0a56cc 100644 --- a/tests/Helper/OngoingTransaction.php +++ b/tests/Helper/OngoingTransaction.php @@ -16,16 +16,16 @@ use function Amp\call; use Amp\Promise; use Generator; -use Prooph\EventStore\AsyncEventStoreTransaction; +use Prooph\EventStore\Async\EventStoreTransaction; use Prooph\EventStore\EventData; /** @internal */ class OngoingTransaction { - /** @var AsyncEventStoreTransaction */ + /** @var EventStoreTransaction */ private $transaction; - public function __construct(AsyncEventStoreTransaction $transaction) + public function __construct(EventStoreTransaction $transaction) { $this->transaction = $transaction; } diff --git a/tests/Helper/ParallelTransactionTask.php b/tests/Helper/ParallelTransactionTask.php index 4a68cc13..92fe13e1 100644 --- a/tests/Helper/ParallelTransactionTask.php +++ b/tests/Helper/ParallelTransactionTask.php @@ -16,7 +16,7 @@ use Amp\Parallel\Worker\Environment; use Amp\Parallel\Worker\Task; use Amp\Promise; -use Prooph\EventStore\AsyncEventStoreTransaction; +use Prooph\EventStore\Async\EventStoreTransaction; use Prooph\EventStore\ExpectedVersion; class ParallelTransactionTask implements Task @@ -42,7 +42,7 @@ public function run(Environment $environment) $this->stream, ExpectedVersion::ANY ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); $writes = []; diff --git a/tests/Helper/StreamWriter.php b/tests/Helper/StreamWriter.php index 5a064e4b..7b8b5819 100644 --- a/tests/Helper/StreamWriter.php +++ b/tests/Helper/StreamWriter.php @@ -16,21 +16,21 @@ use function Amp\call; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\WriteResult; /** @internal */ class StreamWriter { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $connection; /** @var string */ private $stream; /** @var int */ private $version; - public function __construct(AsyncEventStoreConnection $connection, string $stream, int $version) + public function __construct(EventStoreConnection $connection, string $stream, int $version) { $this->connection = $connection; $this->stream = $stream; diff --git a/tests/Helper/TailWriter.php b/tests/Helper/TailWriter.php index 6d9bcd1a..b3827a76 100644 --- a/tests/Helper/TailWriter.php +++ b/tests/Helper/TailWriter.php @@ -16,18 +16,18 @@ use function Amp\call; use Amp\Promise; use Amp\Success; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EventData; /** @internal */ class TailWriter { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $connection; /** @var string */ private $stream; - public function __construct(AsyncEventStoreConnection $connection, string $stream) + public function __construct(EventStoreConnection $connection, string $stream) { $this->connection = $connection; $this->stream = $stream; diff --git a/tests/Helper/TestConnection.php b/tests/Helper/TestConnection.php index fb5b2282..ec361b6a 100644 --- a/tests/Helper/TestConnection.php +++ b/tests/Helper/TestConnection.php @@ -13,7 +13,7 @@ namespace ProophTest\EventStoreClient\Helper; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EndPoint; use Prooph\EventStore\UserCredentials; use Prooph\EventStoreClient\ConnectionSettings; @@ -23,7 +23,7 @@ /** @internal */ class TestConnection { - public static function create(?UserCredentials $userCredentials = null): AsyncEventStoreConnection + public static function create(?UserCredentials $userCredentials = null): EventStoreConnection { self::checkRequiredEnvironmentSettings(); diff --git a/tests/Helper/TransactionalWriter.php b/tests/Helper/TransactionalWriter.php index c6c32d91..f84937dc 100644 --- a/tests/Helper/TransactionalWriter.php +++ b/tests/Helper/TransactionalWriter.php @@ -16,17 +16,17 @@ use function Amp\call; use Amp\Promise; use Generator; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; /** @internal */ class TransactionalWriter { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $connection; /** @var string */ private $stream; - public function __construct(AsyncEventStoreConnection $connection, string $stream) + public function __construct(EventStoreConnection $connection, string $stream) { $this->connection = $connection; $this->stream = $stream; diff --git a/tests/PersistentSubscriptionManagement/persistent_subscription_manager.php b/tests/PersistentSubscriptionManagement/persistent_subscription_manager.php index 5c489247..05482a65 100644 --- a/tests/PersistentSubscriptionManagement/persistent_subscription_manager.php +++ b/tests/PersistentSubscriptionManagement/persistent_subscription_manager.php @@ -18,9 +18,9 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\Exception\InvalidArgumentException; use Prooph\EventStore\ExpectedVersion; @@ -45,7 +45,7 @@ class persistent_subscription_manager extends TestCase private $stream; /** @var PersistentSubscriptionSettings */ private $settings; - /** @var AsyncEventStorePersistentSubscription */ + /** @var EventStorePersistentSubscription */ private $sub; protected function setUp(): void @@ -76,9 +76,9 @@ protected function when(): Generator $this->sub = yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'existing', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { @@ -228,9 +228,9 @@ public function can_replay_parked_messages(): void $this->sub = yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'existing', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { @@ -269,7 +269,7 @@ public function __invoke( yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'existing', - new class($event) implements EventAppearedOnAsyncPersistentSubscription { + new class($event) implements EventAppearedOnPersistentSubscription { /** @var CountdownEvent */ private $event; @@ -279,7 +279,7 @@ public function __construct(CountdownEvent $event) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/ProjectionSpecification.php b/tests/ProjectionSpecification.php index b86da7dc..36b301ec 100644 --- a/tests/ProjectionSpecification.php +++ b/tests/ProjectionSpecification.php @@ -18,7 +18,7 @@ use function Amp\Promise\wait; use Amp\Success; use Generator; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\UserCredentials; @@ -31,7 +31,7 @@ trait ProjectionSpecification { /** @var ProjectionsManager */ protected $projectionsManager; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ protected $connection; /** @var UserCredentials */ protected $credentials; diff --git a/tests/SpecificationWithConnection.php b/tests/SpecificationWithConnection.php index fb87a272..92ccff14 100644 --- a/tests/SpecificationWithConnection.php +++ b/tests/SpecificationWithConnection.php @@ -17,13 +17,13 @@ use function Amp\Promise\wait; use Amp\Success; use Generator; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use ProophTest\EventStoreClient\Helper\TestConnection; use Throwable; trait SpecificationWithConnection { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ protected $conn; protected function given(): Generator diff --git a/tests/a_nak_in_subscription_handler_in_autoack_mode_drops_the_subscription.php b/tests/a_nak_in_subscription_handler_in_autoack_mode_drops_the_subscription.php index f407d69f..ddb60a59 100644 --- a/tests/a_nak_in_subscription_handler_in_autoack_mode_drops_the_subscription.php +++ b/tests/a_nak_in_subscription_handler_in_autoack_mode_drops_the_subscription.php @@ -20,9 +20,9 @@ use Exception; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -81,16 +81,16 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { throw new \Exception('test'); } }, - new class(Closure::fromCallable($dropBehaviour)) implements AsyncPersistentSubscriptionDropped { + new class(Closure::fromCallable($dropBehaviour)) implements PersistentSubscriptionDropped { private $callback; public function __construct(callable $callback) @@ -99,7 +99,7 @@ public function __construct(callable $callback) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/tests/catch_up_subscription_handles_errors.php b/tests/catch_up_subscription_handles_errors.php index 30dd7a55..3b4b55dc 100644 --- a/tests/catch_up_subscription_handles_errors.php +++ b/tests/catch_up_subscription_handles_errors.php @@ -23,16 +23,16 @@ use Exception; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\ClientConnectionEventArgs; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\ClientConnectionEventArgs; use Prooph\EventStore\EndPoint; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventId; use Prooph\EventStore\EventStoreSubscription; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ReadDirection; use Prooph\EventStore\RecordedEvent; use Prooph\EventStore\ResolvedEvent; @@ -106,7 +106,7 @@ protected function setUp(): void self::$streamId, null, null, - new class($props1) implements EventAppearedOnAsyncCatchupSubscription { + new class($props1) implements EventAppearedOnCatchupSubscription { private $props; public function __construct(array &$props) @@ -115,7 +115,7 @@ public function __construct(array &$props) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { $this->props['raisedEvents'][] = $resolvedEvent; @@ -124,7 +124,7 @@ public function __invoke( return new Success(); } }, - new class($props2) implements LiveProcessingStartedOnAsyncCatchUpSubscription { + new class($props2) implements LiveProcessingStartedOnCatchUpSubscription { private $props; public function __construct(array &$props) @@ -132,12 +132,12 @@ public function __construct(array &$props) $this->props = &$props; } - public function __invoke(AsyncEventStoreCatchUpSubscription $subscription): void + public function __invoke(EventStoreCatchUpSubscription $subscription): void { $this->props['liveProcessingStarted'] = true; } }, - new class($props3) implements AsyncCatchUpSubscriptionDropped { + new class($props3) implements CatchUpSubscriptionDropped { private $props; public function __construct(array &$props) @@ -146,7 +146,7 @@ public function __construct(array &$props) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -536,7 +536,7 @@ private function createVolatileSubscription( self::$streamId, false, null, - new class($raise) implements EventAppearedOnAsyncSubscription { + new class($raise) implements EventAppearedOnSubscription { private $raise; public function __construct($raise) diff --git a/tests/catchup_subscription_handles_small_batch_sizes.php b/tests/catchup_subscription_handles_small_batch_sizes.php index 3e2f1c7e..877b3a95 100644 --- a/tests/catchup_subscription_handles_small_batch_sizes.php +++ b/tests/catchup_subscription_handles_small_batch_sizes.php @@ -21,14 +21,14 @@ use Amp\Success; use Amp\TimeoutException; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\LiveProcessingStartedOnCatchUpSubscription; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; -use Prooph\EventStore\LiveProcessingStartedOnAsyncCatchUpSubscription; use Prooph\EventStore\ResolvedEvent; use ProophTest\EventStoreClient\Helper\TestConnection; use Throwable; @@ -41,7 +41,7 @@ class catchup_subscription_handles_small_batch_sizes extends TestCase private $streamName = 'TestStream'; /** @var CatchUpSubscriptionSettings */ private $settings; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $connection; private function setUpTestCase(): Promise @@ -145,11 +145,11 @@ public function catchupSubscriptionToStreamHandlesManyEventsWithSmallBatchSize() })); } - private function eventAppearedResolver(): EventAppearedOnAsyncCatchupSubscription + private function eventAppearedResolver(): EventAppearedOnCatchupSubscription { - return new class() implements EventAppearedOnAsyncCatchupSubscription { + return new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { return new Success(); @@ -159,8 +159,8 @@ public function __invoke( private function liveProcessingStartedResolver( Deferred $deferred - ): LiveProcessingStartedOnAsyncCatchUpSubscription { - return new class($deferred) implements LiveProcessingStartedOnAsyncCatchUpSubscription { + ): LiveProcessingStartedOnCatchUpSubscription { + return new class($deferred) implements LiveProcessingStartedOnCatchUpSubscription { private $deferred; public function __construct(Deferred $deferred) @@ -168,7 +168,7 @@ public function __construct(Deferred $deferred) $this->deferred = $deferred; } - public function __invoke(AsyncEventStoreCatchUpSubscription $subscription): void + public function __invoke(EventStoreCatchUpSubscription $subscription): void { $this->deferred->resolve(true); } diff --git a/tests/connect.php b/tests/connect.php index 393834a6..5ef79552 100644 --- a/tests/connect.php +++ b/tests/connect.php @@ -20,8 +20,8 @@ use function Amp\Promise\wait; use Amp\TimeoutException; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\ClientClosedEventArgs; +use Prooph\EventStore\Async\ClientClosedEventArgs; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EndPoint; use Prooph\EventStore\Exception\InvalidOperationException; use Prooph\EventStore\ExpectedVersion; @@ -117,7 +117,7 @@ public function should_close_connection_after_configured_amount_of_failed_reconn ); $connection->onClosed(function (ClientClosedEventArgs $args) use ($closed) { - $this->assertInstanceOf(AsyncEventStoreConnection::class, $args->connection()); + $this->assertInstanceOf(EventStoreConnection::class, $args->connection()); $this->assertEquals('Reconnection limit reached', $args->reason()); $closed->resolve(true); diff --git a/tests/connect_to_existing_persistent_subscription_with_max_one_client.php b/tests/connect_to_existing_persistent_subscription_with_max_one_client.php index aa98c375..2fc6a98d 100644 --- a/tests/connect_to_existing_persistent_subscription_with_max_one_client.php +++ b/tests/connect_to_existing_persistent_subscription_with_max_one_client.php @@ -17,8 +17,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\Exception\MaximumSubscribersReached; use Prooph\EventStore\PersistentSubscriptionSettings; use Prooph\EventStore\ResolvedEvent; @@ -37,7 +37,7 @@ class connect_to_existing_persistent_subscription_with_max_one_client extends Te private $exception; /** @var string */ private $group = 'startinbeginning1'; - /** @var AsyncEventStorePersistentSubscription|null */ + /** @var EventStorePersistentSubscription|null */ private $firstSubscription; protected function setUp(): void @@ -62,9 +62,9 @@ protected function given(): Generator $this->firstSubscription = yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { @@ -86,9 +86,9 @@ protected function when(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_permissions.php b/tests/connect_to_existing_persistent_subscription_with_permissions.php index 289009c3..c5864137 100644 --- a/tests/connect_to_existing_persistent_subscription_with_permissions.php +++ b/tests/connect_to_existing_persistent_subscription_with_permissions.php @@ -17,8 +17,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\PersistentSubscriptionSettings; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\Util\Guid; @@ -56,9 +56,9 @@ protected function when(): Generator $this->sub = $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'agroupname17', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_events_in_it.php b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_events_in_it.php index 4b2aaf3d..45bc11b3 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_events_in_it.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_events_in_it.php @@ -19,8 +19,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -91,7 +91,7 @@ protected function when(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->set, $this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->set, $this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $set; private $deferred; private $firstEvent; @@ -104,7 +104,7 @@ public function __construct(&$set, &$deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_no_stream.php b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_no_stream.php index 9504892f..984109ec 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_no_stream.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_and_no_stream.php @@ -19,8 +19,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -70,7 +70,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->set, $this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->set, $this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $set; private $deferred; private $firstEvent; @@ -83,7 +83,7 @@ public function __construct(&$set, &$deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it.php b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it.php index f097d4db..181cadea 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it.php @@ -20,8 +20,8 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\PersistentSubscriptionSettings; @@ -68,7 +68,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($deferred) implements EventAppearedOnAsyncPersistentSubscription { + new class($deferred) implements EventAppearedOnPersistentSubscription { private $deferred; public function __construct($deferred) @@ -77,7 +77,7 @@ public function __construct($deferred) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it_then_event_written.php b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it_then_event_written.php index 06e3b95a..faa9ffd8 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it_then_event_written.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_beginning_not_set_and_events_in_it_then_event_written.php @@ -18,8 +18,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -78,7 +78,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $deferred; private $firstEvent; @@ -89,7 +89,7 @@ public function __construct($deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_two_and_no_stream.php b/tests/connect_to_existing_persistent_subscription_with_start_from_two_and_no_stream.php index fd69e85b..0fb64060 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_two_and_no_stream.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_two_and_no_stream.php @@ -18,8 +18,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -70,7 +70,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->set, $this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->set, $this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $set; private $deferred; private $firstEvent; @@ -83,7 +83,7 @@ public function __construct(&$set, &$deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it.php b/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it.php index 12632893..c1de8cb6 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it.php @@ -19,8 +19,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -70,7 +70,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $deferred; private $firstEvent; private $set = false; @@ -82,7 +82,7 @@ public function __construct($deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it_then_event_written.php b/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it_then_event_written.php index 2f0f545b..ec66d2d0 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it_then_event_written.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_and_events_in_it_then_event_written.php @@ -19,8 +19,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -70,7 +70,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $deferred; private $firstEvent; @@ -81,7 +81,7 @@ public function __construct($deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written.php b/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written.php index f714b6e3..3468b8f1 100644 --- a/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written.php +++ b/tests/connect_to_existing_persistent_subscription_with_start_from_x_set_higher_than_x_and_events_in_it_then_event_written.php @@ -18,8 +18,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -78,7 +78,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, $this->group, - new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->resetEvent, $this->firstEvent) implements EventAppearedOnPersistentSubscription { private $deferred; private $firstEvent; @@ -89,7 +89,7 @@ public function __construct($deferred, &$firstEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_existing_persistent_subscription_without_permissions.php b/tests/connect_to_existing_persistent_subscription_without_permissions.php index 019b703b..918c93c8 100644 --- a/tests/connect_to_existing_persistent_subscription_without_permissions.php +++ b/tests/connect_to_existing_persistent_subscription_without_permissions.php @@ -17,8 +17,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\Exception\AccessDenied; use Prooph\EventStore\PersistentSubscriptionSettings; use Prooph\EventStore\ResolvedEvent; @@ -55,9 +55,9 @@ protected function when(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'agroupname55', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_non_existing_persistent_subscription_with_permissions.php b/tests/connect_to_non_existing_persistent_subscription_with_permissions.php index e7e823c3..d8758604 100644 --- a/tests/connect_to_non_existing_persistent_subscription_with_permissions.php +++ b/tests/connect_to_non_existing_persistent_subscription_with_permissions.php @@ -17,8 +17,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\Exception\InvalidArgumentException; use Prooph\EventStore\ResolvedEvent; use Throwable; @@ -36,9 +36,9 @@ protected function when(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( 'nonexisting2', 'foo', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/connect_to_persistent_subscription_with_retries.php b/tests/connect_to_persistent_subscription_with_retries.php index 196cfb19..e7dd6f3b 100644 --- a/tests/connect_to_persistent_subscription_with_retries.php +++ b/tests/connect_to_persistent_subscription_with_retries.php @@ -18,8 +18,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -68,7 +68,7 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'agroupname55', - new class($this->retryCount, $this->resetEvent) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->retryCount, $this->resetEvent) implements EventAppearedOnPersistentSubscription { private $retryCount; private $resetEvent; @@ -79,7 +79,7 @@ public function __construct(&$retryCount, $resetEvent) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/deleting_existing_persistent_subscription_with_subscriber.php b/tests/deleting_existing_persistent_subscription_with_subscriber.php index c9b1df53..cdd77481 100644 --- a/tests/deleting_existing_persistent_subscription_with_subscriber.php +++ b/tests/deleting_existing_persistent_subscription_with_subscriber.php @@ -18,9 +18,9 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\PersistentSubscriptionSettings; use Prooph\EventStore\ResolvedEvent; use Prooph\EventStore\SubscriptionDropReason; @@ -60,16 +60,16 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'groupname123', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { return new Success(); } }, - new class($this->called) implements AsyncPersistentSubscriptionDropped { + new class($this->called) implements PersistentSubscriptionDropped { private $called; public function __construct(&$called) @@ -78,7 +78,7 @@ public function __construct(&$called) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/tests/event_store_connection_should.php b/tests/event_store_connection_should.php index 208cefda..6d6a7c54 100644 --- a/tests/event_store_connection_should.php +++ b/tests/event_store_connection_should.php @@ -18,7 +18,7 @@ use function Amp\Promise\wait; use Amp\Success; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\Exception\InvalidOperationException; use Prooph\EventStore\Position; @@ -115,7 +115,7 @@ public function throw_invalid_operation_on_every_api_call_if_connect_was_not_cal yield $connection->subscribeToStreamAsync( $s, false, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent @@ -133,7 +133,7 @@ public function __invoke( try { yield $connection->subscribeToAllAsync( false, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent diff --git a/tests/happy_case_catching_up_to_link_to_events_auto_ack.php b/tests/happy_case_catching_up_to_link_to_events_auto_ack.php index 5847527c..81a7e79a 100644 --- a/tests/happy_case_catching_up_to_link_to_events_auto_ack.php +++ b/tests/happy_case_catching_up_to_link_to_events_auto_ack.php @@ -19,9 +19,9 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\Common\SystemEventTypes; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -92,7 +92,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnPersistentSubscription { private $eventsReceived; private $eventReceivedCount; private $eventWriteCount; @@ -105,7 +105,7 @@ public function __construct(Deferred $eventsReceived, &$eventReceivedCount, int } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/happy_case_catching_up_to_link_to_events_manual_ack.php b/tests/happy_case_catching_up_to_link_to_events_manual_ack.php index f588cd42..7a1d02de 100644 --- a/tests/happy_case_catching_up_to_link_to_events_manual_ack.php +++ b/tests/happy_case_catching_up_to_link_to_events_manual_ack.php @@ -19,9 +19,9 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\Common\SystemEventTypes; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -92,7 +92,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnPersistentSubscription { private $eventsReceived; private $eventReceivedCount; private $eventWriteCount; @@ -105,7 +105,7 @@ public function __construct(Deferred $eventsReceived, &$eventReceivedCount, int } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/happy_case_catching_up_to_normal_events_auto_ack.php b/tests/happy_case_catching_up_to_normal_events_auto_ack.php index 70a64a3e..efc60958 100644 --- a/tests/happy_case_catching_up_to_normal_events_auto_ack.php +++ b/tests/happy_case_catching_up_to_normal_events_auto_ack.php @@ -19,8 +19,8 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -91,7 +91,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnPersistentSubscription { private $eventsReceived; private $eventReceivedCount; private $eventWriteCount; @@ -104,7 +104,7 @@ public function __construct(Deferred $eventsReceived, &$eventReceivedCount, $eve } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/happy_case_catching_up_to_normal_events_manual_ack.php b/tests/happy_case_catching_up_to_normal_events_manual_ack.php index b4e408b6..9e796322 100644 --- a/tests/happy_case_catching_up_to_normal_events_manual_ack.php +++ b/tests/happy_case_catching_up_to_normal_events_manual_ack.php @@ -19,8 +19,8 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventId; use Prooph\EventStore\ExpectedVersion; @@ -91,7 +91,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnPersistentSubscription { private $eventsReceived; private $eventReceivedCount; private $eventWriteCount; @@ -104,7 +104,7 @@ public function __construct(Deferred $eventsReceived, &$eventReceivedCount, $eve } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/happy_case_writing_and_subscribing_to_normal_events_auto_ack.php b/tests/happy_case_writing_and_subscribing_to_normal_events_auto_ack.php index f3d23a33..68bba061 100644 --- a/tests/happy_case_writing_and_subscribing_to_normal_events_auto_ack.php +++ b/tests/happy_case_writing_and_subscribing_to_normal_events_auto_ack.php @@ -20,8 +20,8 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\PersistentSubscriptionSettings; @@ -79,7 +79,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnPersistentSubscription { private $eventsReceived; private $eventReceivedCount; private $eventWriteCount; @@ -92,7 +92,7 @@ public function __construct(Deferred $eventsReceived, &$eventReceivedCount, $eve } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/happy_case_writing_and_subscribing_to_normal_events_manual_ack.php b/tests/happy_case_writing_and_subscribing_to_normal_events_manual_ack.php index 26f30db3..ce13e85a 100644 --- a/tests/happy_case_writing_and_subscribing_to_normal_events_manual_ack.php +++ b/tests/happy_case_writing_and_subscribing_to_normal_events_manual_ack.php @@ -20,8 +20,8 @@ use Amp\TimeoutException; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\PersistentSubscriptionSettings; @@ -79,7 +79,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventsReceived, $this->eventReceivedCount, self::EVENT_WRITE_COUNT) implements EventAppearedOnPersistentSubscription { private $eventsReceived; private $eventReceivedCount; private $eventWriteCount; @@ -92,7 +92,7 @@ public function __construct(Deferred $eventsReceived, &$eventReceivedCount, $eve } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { diff --git a/tests/soft_delete.php b/tests/soft_delete.php index eb6269e9..448a9202 100644 --- a/tests/soft_delete.php +++ b/tests/soft_delete.php @@ -18,7 +18,7 @@ use function Amp\Promise\wait; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EventData; use Prooph\EventStore\Exception\StreamDeleted; use Prooph\EventStore\Exception\WrongExpectedVersion; @@ -36,7 +36,7 @@ class soft_delete extends TestCase { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; protected function setUpTestCase(): Generator diff --git a/tests/subscribe_should.php b/tests/subscribe_should.php index 8b09561d..360052f5 100644 --- a/tests/subscribe_should.php +++ b/tests/subscribe_should.php @@ -21,7 +21,7 @@ use Amp\Success; use Amp\TimeoutException; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\ResolvedEvent; @@ -135,7 +135,7 @@ public function call_dropped_callback_after_unsubscribe_method_call(): void $subscription = yield $connection->subscribeToStreamAsync( $stream, false, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent @@ -194,9 +194,9 @@ public function catch_deleted_events_as_well(): void })); } - private function eventAppearedResolver(Deferred $deferred): EventAppearedOnAsyncSubscription + private function eventAppearedResolver(Deferred $deferred): EventAppearedOnSubscription { - return new class($deferred) implements EventAppearedOnAsyncSubscription { + return new class($deferred) implements EventAppearedOnSubscription { private $deferred; public function __construct(Deferred $deferred) diff --git a/tests/subscribe_to_all_catching_up_should.php b/tests/subscribe_to_all_catching_up_should.php index 1c30444e..07d15e7b 100644 --- a/tests/subscribe_to_all_catching_up_should.php +++ b/tests/subscribe_to_all_catching_up_should.php @@ -21,14 +21,14 @@ use Generator; use PHPUnit\Framework\TestCase; use Prooph\EventStore\AllEventsSlice; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\CatchUpSubscriptionSettings; use Prooph\EventStore\Common\SystemRoles; use Prooph\EventStore\Common\SystemStreams; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\ExpectedVersion; @@ -47,7 +47,7 @@ class subscribe_to_all_catching_up_should extends TestCase { private const TIMEOUT = 10000; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; /** @@ -96,16 +96,16 @@ public function call_dropped_callback_after_stop_method_call(): void $subscription = yield $store->subscribeToAllFromAsync( null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncCatchupSubscription { + new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { return new Success(); } }, null, - new class($dropped) implements AsyncCatchUpSubscriptionDropped { + new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -115,7 +115,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -155,16 +155,16 @@ public function call_dropped_callback_when_an_error_occurs_while_processing_an_e $subscription = yield $store->subscribeToAllFromAsync( null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncCatchupSubscription { + new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { throw new Exception('Error'); } }, null, - new class($dropped) implements AsyncCatchUpSubscriptionDropped { + new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -174,7 +174,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -210,7 +210,7 @@ public function be_able_to_subscribe_to_empty_db(): void $subscription = yield $store->subscribeToAllFromAsync( null, CatchUpSubscriptionSettings::default(), - new class($appeared) implements EventAppearedOnAsyncCatchupSubscription { + new class($appeared) implements EventAppearedOnCatchupSubscription { /** @var ManualResetEventSlim */ private $appeared; @@ -220,7 +220,7 @@ public function __construct(ManualResetEventSlim $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { if (! SystemStreams::isSystemStream($resolvedEvent->originalEvent()->eventStreamId())) { @@ -231,7 +231,7 @@ public function __invoke( } }, null, - new class($dropped) implements AsyncCatchUpSubscriptionDropped { + new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -241,7 +241,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -255,7 +255,7 @@ public function __invoke( yield $store->subscribeToAllAsync( false, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent @@ -306,7 +306,7 @@ public function read_all_existing_events_and_keep_listening_to_new_ones(): void $subscription = yield $store->subscribeToAllFromAsync( $position, CatchUpSubscriptionSettings::default(), - new class($events, $appeared) implements EventAppearedOnAsyncCatchupSubscription { + new class($events, $appeared) implements EventAppearedOnCatchupSubscription { /** @var array */ private $events; /** @var CountdownEvent */ @@ -319,7 +319,7 @@ public function __construct(array &$events, CountdownEvent $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { if (! SystemStreams::isSystemStream($resolvedEvent->originalEvent()->eventStreamId())) { @@ -331,7 +331,7 @@ public function __invoke( } }, null, - new class($dropped) implements AsyncCatchUpSubscriptionDropped { + new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -341,7 +341,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -412,7 +412,7 @@ public function filter_events_and_keep_listening_to_new_ones(): void $subscription = yield $store->subscribeToAllFromAsync( $lastEvent->originalPosition(), CatchUpSubscriptionSettings::default(), - new class($events, $appeared) implements EventAppearedOnAsyncCatchupSubscription { + new class($events, $appeared) implements EventAppearedOnCatchupSubscription { /** @var array */ private $events; /** @var CountdownEvent */ @@ -425,7 +425,7 @@ public function __construct(array &$events, CountdownEvent $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { if (! SystemStreams::isSystemStream($resolvedEvent->originalEvent()->eventStreamId())) { @@ -437,7 +437,7 @@ public function __invoke( } }, null, - new class($dropped) implements AsyncCatchUpSubscriptionDropped { + new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -447,7 +447,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -522,7 +522,7 @@ public function filter_events_and_work_if_nothing_was_written_after_subscription $subscription = yield $store->subscribeToAllFromAsync( $lastEvent->originalPosition(), CatchUpSubscriptionSettings::default(), - new class($events, $appeared) implements EventAppearedOnAsyncCatchupSubscription { + new class($events, $appeared) implements EventAppearedOnCatchupSubscription { /** @var array */ private $events; /** @var CountdownEvent */ @@ -535,7 +535,7 @@ public function __construct(array &$events, CountdownEvent $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { $this->events[] = $resolvedEvent; @@ -545,7 +545,7 @@ public function __invoke( } }, null, - new class($dropped) implements AsyncCatchUpSubscriptionDropped { + new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -555,7 +555,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/tests/subscribe_to_all_should.php b/tests/subscribe_to_all_should.php index ea157914..27249fd1 100644 --- a/tests/subscribe_to_all_should.php +++ b/tests/subscribe_to_all_should.php @@ -19,8 +19,8 @@ use Amp\Success; use Amp\TimeoutException; use PHPUnit\Framework\TestCase; +use Prooph\EventStore\Async\EventAppearedOnSubscription; use Prooph\EventStore\Common\SystemRoles; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\ResolvedEvent; @@ -149,9 +149,9 @@ public function catch_deleted_events_as_well(): void }); } - private function appearedWithCountdown(CountdownEvent $appeared): EventAppearedOnAsyncSubscription + private function appearedWithCountdown(CountdownEvent $appeared): EventAppearedOnSubscription { - return new class($appeared) implements EventAppearedOnAsyncSubscription { + return new class($appeared) implements EventAppearedOnSubscription { /** @var CountdownEvent */ private $appeared; diff --git a/tests/subscribe_to_stream_catching_up_should.php b/tests/subscribe_to_stream_catching_up_should.php index 0227cd65..2f29fdb0 100644 --- a/tests/subscribe_to_stream_catching_up_should.php +++ b/tests/subscribe_to_stream_catching_up_should.php @@ -19,12 +19,12 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncCatchUpSubscriptionDropped; -use Prooph\EventStore\AsyncEventStoreCatchUpSubscription; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\CatchUpSubscriptionDropped; +use Prooph\EventStore\Async\EventAppearedOnCatchupSubscription; +use Prooph\EventStore\Async\EventAppearedOnSubscription; +use Prooph\EventStore\Async\EventStoreCatchUpSubscription; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\CatchUpSubscriptionSettings; -use Prooph\EventStore\EventAppearedOnAsyncCatchupSubscription; -use Prooph\EventStore\EventAppearedOnAsyncSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\EventStoreSubscription; use Prooph\EventStore\ExpectedVersion; @@ -40,7 +40,7 @@ class subscribe_to_stream_catching_up_should extends TestCase { private const TIMEOUT = 5000; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; /** @@ -86,7 +86,7 @@ public function be_able_to_subscribe_to_non_existing_stream(): void yield $this->conn->subscribeToStreamAsync( $stream, false, - new class() implements EventAppearedOnAsyncSubscription { + new class() implements EventAppearedOnSubscription { public function __invoke( EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent @@ -220,9 +220,9 @@ public function call_dropped_callback_after_stop_method_call(): void $stream, null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncCatchupSubscription { + new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { return new Success(); @@ -260,9 +260,9 @@ public function call_dropped_callback_when_an_error_occurs_while_processing_an_e $stream, null, CatchUpSubscriptionSettings::default(), - new class() implements EventAppearedOnAsyncCatchupSubscription { + new class() implements EventAppearedOnCatchupSubscription { public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { throw new \Exception('Error'); @@ -451,9 +451,9 @@ public function filter_events_and_work_if_nothing_was_written_after_subscription }); } - private function appearedWithCountdown(CountdownEvent $appeared): EventAppearedOnAsyncCatchupSubscription + private function appearedWithCountdown(CountdownEvent $appeared): EventAppearedOnCatchupSubscription { - return new class($appeared) implements EventAppearedOnAsyncCatchupSubscription { + return new class($appeared) implements EventAppearedOnCatchupSubscription { /** @var CountdownEvent */ private $appeared; @@ -463,7 +463,7 @@ public function __construct(CountdownEvent $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { $this->appeared->signal(); @@ -473,9 +473,9 @@ public function __invoke( }; } - private function appearedWithCountdownAndEventsAdd(array &$events, CountdownEvent $appeared): EventAppearedOnAsyncCatchupSubscription + private function appearedWithCountdownAndEventsAdd(array &$events, CountdownEvent $appeared): EventAppearedOnCatchupSubscription { - return new class($events, $appeared) implements EventAppearedOnAsyncCatchupSubscription { + return new class($events, $appeared) implements EventAppearedOnCatchupSubscription { /** @var array */ private $events; /** @var CountdownEvent */ @@ -488,7 +488,7 @@ public function __construct(array &$events, CountdownEvent $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { $this->events[] = $resolvedEvent; @@ -499,9 +499,9 @@ public function __invoke( }; } - private function appearedWithResetEvent(ManualResetEventSlim $appeared): EventAppearedOnAsyncCatchupSubscription + private function appearedWithResetEvent(ManualResetEventSlim $appeared): EventAppearedOnCatchupSubscription { - return new class($appeared) implements EventAppearedOnAsyncCatchupSubscription { + return new class($appeared) implements EventAppearedOnCatchupSubscription { /** @var ManualResetEventSlim */ private $appeared; @@ -511,7 +511,7 @@ public function __construct(ManualResetEventSlim $appeared) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, ResolvedEvent $resolvedEvent ): Promise { $this->appeared->set(); @@ -521,9 +521,9 @@ public function __invoke( }; } - private function droppedWithCountdown(CountdownEvent $dropped): AsyncCatchUpSubscriptionDropped + private function droppedWithCountdown(CountdownEvent $dropped): CatchUpSubscriptionDropped { - return new class($dropped) implements AsyncCatchUpSubscriptionDropped { + return new class($dropped) implements CatchUpSubscriptionDropped { /** @var CountdownEvent */ private $dropped; @@ -533,7 +533,7 @@ public function __construct(CountdownEvent $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { @@ -542,9 +542,9 @@ public function __invoke( }; } - private function droppedWithResetEvent(ManualResetEventSlim $dropped): AsyncCatchUpSubscriptionDropped + private function droppedWithResetEvent(ManualResetEventSlim $dropped): CatchUpSubscriptionDropped { - return new class($dropped) implements AsyncCatchUpSubscriptionDropped { + return new class($dropped) implements CatchUpSubscriptionDropped { /** @var ManualResetEventSlim */ private $dropped; @@ -554,7 +554,7 @@ public function __construct(ManualResetEventSlim $dropped) } public function __invoke( - AsyncEventStoreCatchUpSubscription $subscription, + EventStoreCatchUpSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/tests/transaction.php b/tests/transaction.php index 85112e9c..ada8f8e3 100644 --- a/tests/transaction.php +++ b/tests/transaction.php @@ -17,8 +17,8 @@ use Amp\Parallel\Worker\DefaultPool; use Amp\Promise; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\AsyncEventStoreTransaction; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\EventStoreTransaction; use Prooph\EventStore\EventData; use Prooph\EventStore\Exception\StreamDeleted; use Prooph\EventStore\Exception\WrongExpectedVersion; @@ -32,7 +32,7 @@ class transaction extends TestCase { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; /** @@ -64,7 +64,7 @@ public function should_start_on_non_existing_stream_with_correct_exp_ver_and_cre $stream, ExpectedVersion::NO_STREAM ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $transaction->writeAsync([TestEvent::newTestEvent()]); @@ -88,7 +88,7 @@ public function should_start_on_non_existing_stream_with_exp_ver_any_and_create_ $stream, ExpectedVersion::ANY ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $transaction->writeAsync([TestEvent::newTestEvent()]); @@ -112,7 +112,7 @@ public function should_fail_to_commit_non_existing_stream_with_wrong_exp_ver(): $stream, 1 ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $transaction->writeAsync([TestEvent::newTestEvent()]); @@ -135,7 +135,7 @@ public function should_do_nothing_if_commits_no_events_to_empty_stream(): void $stream, ExpectedVersion::NO_STREAM ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); $result = yield $transaction->commitAsync(); \assert($result instanceof WriteResult); @@ -167,7 +167,7 @@ public function should_do_nothing_if_transactionally_writing_no_events_to_empty_ $stream, ExpectedVersion::NO_STREAM ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $transaction->writeAsync(); @@ -201,7 +201,7 @@ public function should_validate_expectations_on_commit(): void $stream, 100500 ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $transaction->writeAsync([TestEvent::newTestEvent()]); @@ -278,7 +278,7 @@ public function should_fail_to_commit_if_started_with_correct_ver_but_committing $stream, ExpectedVersion::EMPTY_STREAM ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $this->conn->appendToStreamAsync($stream, ExpectedVersion::EMPTY_STREAM, [TestEvent::newTestEvent()]); @@ -303,7 +303,7 @@ public function should_not_fail_to_commit_if_started_with_wrong_ver_but_committi $stream, 0 ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $this->conn->appendToStreamAsync($stream, ExpectedVersion::EMPTY_STREAM, [TestEvent::newTestEvent()]); @@ -329,7 +329,7 @@ public function should_fail_to_commit_if_started_with_correct_ver_but_on_commit_ $stream, ExpectedVersion::EMPTY_STREAM ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); yield $transaction->writeAsync([TestEvent::newTestEvent()]); @@ -356,7 +356,7 @@ public function idempotency_is_correct_for_explicit_transactions_with_expected_v $stream, ExpectedVersion::ANY ); - \assert($transaction1 instanceof AsyncEventStoreTransaction); + \assert($transaction1 instanceof EventStoreTransaction); yield $transaction1->writeAsync([$event]); $result1 = yield $transaction1->commitAsync(); \assert($result1 instanceof WriteResult); @@ -366,7 +366,7 @@ public function idempotency_is_correct_for_explicit_transactions_with_expected_v $stream, ExpectedVersion::ANY ); - \assert($transaction2 instanceof AsyncEventStoreTransaction); + \assert($transaction2 instanceof EventStoreTransaction); yield $transaction2->writeAsync([$event]); $result2 = yield $transaction2->commitAsync(); \assert($result2 instanceof WriteResult); diff --git a/tests/update_existing_persistent_subscription_with_subscribers.php b/tests/update_existing_persistent_subscription_with_subscribers.php index 2f0767cc..f737ac69 100644 --- a/tests/update_existing_persistent_subscription_with_subscribers.php +++ b/tests/update_existing_persistent_subscription_with_subscribers.php @@ -18,9 +18,9 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\AsyncPersistentSubscriptionDropped; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; +use Prooph\EventStore\Async\PersistentSubscriptionDropped; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\PersistentSubscriptionSettings; @@ -70,16 +70,16 @@ protected function given(): Generator yield $this->conn->connectToPersistentSubscriptionAsync( $this->stream, 'existing', - new class() implements EventAppearedOnAsyncPersistentSubscription { + new class() implements EventAppearedOnPersistentSubscription { public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise { return new Success(); } }, - new class($this->dropped, $this->reason, $this->exception) implements AsyncPersistentSubscriptionDropped { + new class($this->dropped, $this->reason, $this->exception) implements PersistentSubscriptionDropped { /** @var Deferred */ private $dropped; /** @var SubscriptionDropReason */ @@ -95,7 +95,7 @@ public function __construct($dropped, &$reason, &$exception) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null ): void { diff --git a/tests/when_committing_empty_transaction.php b/tests/when_committing_empty_transaction.php index 849800ce..a1e94d70 100644 --- a/tests/when_committing_empty_transaction.php +++ b/tests/when_committing_empty_transaction.php @@ -17,8 +17,8 @@ use function Amp\Promise\wait; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; -use Prooph\EventStore\AsyncEventStoreTransaction; +use Prooph\EventStore\Async\EventStoreConnection; +use Prooph\EventStore\Async\EventStoreTransaction; use Prooph\EventStore\EventData; use Prooph\EventStore\Exception\WrongExpectedVersion; use Prooph\EventStore\ExpectedVersion; @@ -32,7 +32,7 @@ class when_committing_empty_transaction extends TestCase { - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $connection; /** @var EventData */ private $firstEvent; @@ -63,7 +63,7 @@ private function bootstrap(): Generator $this->stream, 2 ); - \assert($transaction instanceof AsyncEventStoreTransaction); + \assert($transaction instanceof EventStoreTransaction); $result = yield $transaction->commitAsync(); \assert($result instanceof WriteResult); diff --git a/tests/when_having_max_count_set_for_stream.php b/tests/when_having_max_count_set_for_stream.php index 822f3351..30ca5353 100644 --- a/tests/when_having_max_count_set_for_stream.php +++ b/tests/when_having_max_count_set_for_stream.php @@ -18,7 +18,7 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\SliceReadStatus; @@ -32,7 +32,7 @@ class when_having_max_count_set_for_stream extends TestCase { /** @var string */ private $stream = 'max-count-test-stream'; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; /** @var EventData[] */ private $testEvents = []; diff --git a/tests/when_working_with_raw_stream_metadata.php b/tests/when_working_with_raw_stream_metadata.php index 803c551d..56431482 100644 --- a/tests/when_working_with_raw_stream_metadata.php +++ b/tests/when_working_with_raw_stream_metadata.php @@ -17,7 +17,7 @@ use function Amp\Promise\wait; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\Exception\StreamDeleted; use Prooph\EventStore\Exception\WrongExpectedVersion; use Prooph\EventStore\ExpectedVersion; @@ -30,7 +30,7 @@ class when_working_with_raw_stream_metadata extends TestCase { /** @var string */ private $stream; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; /** @throws Throwable */ diff --git a/tests/when_working_with_stream_metadata_as_structured_info.php b/tests/when_working_with_stream_metadata_as_structured_info.php index d3317ef9..8ede05fd 100644 --- a/tests/when_working_with_stream_metadata_as_structured_info.php +++ b/tests/when_working_with_stream_metadata_as_structured_info.php @@ -16,7 +16,7 @@ use function Amp\call; use function Amp\Promise\wait; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStoreConnection; +use Prooph\EventStore\Async\EventStoreConnection; use Prooph\EventStore\Exception\RuntimeException; use Prooph\EventStore\Exception\WrongExpectedVersion; use Prooph\EventStore\ExpectedVersion; @@ -31,7 +31,7 @@ class when_working_with_stream_metadata_as_structured_info extends TestCase { /** @var string */ private $stream; - /** @var AsyncEventStoreConnection */ + /** @var EventStoreConnection */ private $conn; /** @throws Throwable */ diff --git a/tests/when_writing_and_subscribing_to_normal_events_manual_nack.php b/tests/when_writing_and_subscribing_to_normal_events_manual_nack.php index 45b41723..0497db33 100644 --- a/tests/when_writing_and_subscribing_to_normal_events_manual_nack.php +++ b/tests/when_writing_and_subscribing_to_normal_events_manual_nack.php @@ -18,8 +18,8 @@ use Amp\Success; use Generator; use PHPUnit\Framework\TestCase; -use Prooph\EventStore\AsyncEventStorePersistentSubscription; -use Prooph\EventStore\EventAppearedOnAsyncPersistentSubscription; +use Prooph\EventStore\Async\EventAppearedOnPersistentSubscription; +use Prooph\EventStore\Async\EventStorePersistentSubscription; use Prooph\EventStore\EventData; use Prooph\EventStore\ExpectedVersion; use Prooph\EventStore\PersistentSubscriptionNakEventAction; @@ -79,7 +79,7 @@ public function test(): void yield $this->conn->connectToPersistentSubscriptionAsync( $this->streamName, $this->groupName, - new class($this->eventReceivedCount, $this->eventsReceived) implements EventAppearedOnAsyncPersistentSubscription { + new class($this->eventReceivedCount, $this->eventsReceived) implements EventAppearedOnPersistentSubscription { /** @var int */ private $eventReceivedCount; /** @var Deferred */ @@ -92,7 +92,7 @@ public function __construct(int &$eventReceivedCount, Deferred $eventsReceived) } public function __invoke( - AsyncEventStorePersistentSubscription $subscription, + EventStorePersistentSubscription $subscription, ResolvedEvent $resolvedEvent, ?int $retryCount = null ): Promise {