diff --git a/app/init/resources.php b/app/init/resources.php index 2fa10cd162..4897062b00 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -47,7 +47,7 @@ use Utopia\Pools\Adapter\Swoole as SwoolePoolAdapter; use Utopia\Pools\Group; use Utopia\Pools\Pool as Connections; use Utopia\Queue\Broker\Pool as BrokerPool; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\Storage\Device; use Utopia\Storage\Device\AWS; diff --git a/app/init/resources/request.php b/app/init/resources/request.php index d6551a3750..d161832a57 100644 --- a/app/init/resources/request.php +++ b/app/init/resources/request.php @@ -53,7 +53,7 @@ use Utopia\Http\Http; use Utopia\Locale\Locale; use Utopia\Lock\Distributed as DistributedLock; use Utopia\Pools\Group; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\Storage\Device; use Utopia\System\System; diff --git a/app/init/worker/message.php b/app/init/worker/message.php index 9d7c4c0db5..47881c2927 100644 --- a/app/init/worker/message.php +++ b/app/init/worker/message.php @@ -20,7 +20,7 @@ use Utopia\Database\Document; use Utopia\Database\Validator\Authorization; use Utopia\DI\Container; use Utopia\Pools\Group; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\Span\Span; use Utopia\Storage\Device\Telemetry as TelemetryDevice; diff --git a/composer.json b/composer.json index 59e5ca5215..f6da65513c 100644 --- a/composer.json +++ b/composer.json @@ -93,10 +93,10 @@ "utopia-php/lock": "0.3.*", "utopia-php/messaging": "^2.1", "utopia-php/migration": "^2.0.0", - "utopia-php/platform": "1.0.0-rc18", + "utopia-php/platform": "1.0.0-rc20", "utopia-php/pools": "2.*", "utopia-php/span": "^4.2", - "utopia-php/queue": "^1.3.0", + "utopia-php/queue": "^2.0.0", "utopia-php/servers": "0.4.*", "utopia-php/registry": "0.5.*", "utopia-php/storage": "^4.0", diff --git a/composer.lock b/composer.lock index 3584201803..7d360ac9a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "99688d2abcea9878ce6e9b4bf8106770", + "content-hash": "35704e3e15b6146538aed2bdeab97ca3", "packages": [ { "name": "adhocore/jwt", @@ -3388,16 +3388,16 @@ }, { "name": "utopia-php/cli", - "version": "0.24.3", + "version": "0.24.4", "source": { "type": "git", "url": "https://github.com/utopia-php/cli.git", - "reference": "d6a27f2902e777c2985e834ffb3e662130fd7ecc" + "reference": "39d590ffe67b0d63f107ad45533a85163899bc08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cli/zipball/d6a27f2902e777c2985e834ffb3e662130fd7ecc", - "reference": "d6a27f2902e777c2985e834ffb3e662130fd7ecc", + "url": "https://api.github.com/repos/utopia-php/cli/zipball/39d590ffe67b0d63f107ad45533a85163899bc08", + "reference": "39d590ffe67b0d63f107ad45533a85163899bc08", "shasum": "" }, "require": { @@ -3429,9 +3429,9 @@ ], "support": { "issues": "https://github.com/utopia-php/cli/issues", - "source": "https://github.com/utopia-php/cli/tree/0.24.3" + "source": "https://github.com/utopia-php/cli/tree/0.24.4" }, - "time": "2026-06-26T10:48:18+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/client", @@ -3492,16 +3492,16 @@ }, { "name": "utopia-php/compression", - "version": "0.1.7", + "version": "0.1.8", "source": { "type": "git", "url": "https://github.com/utopia-php/compression.git", - "reference": "655adbd2e42ba28f3148e0aaaf03a68dd6a1bd44" + "reference": "8a23fdec63623aa6ad64ed764d688e67cf2c110e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/compression/zipball/655adbd2e42ba28f3148e0aaaf03a68dd6a1bd44", - "reference": "655adbd2e42ba28f3148e0aaaf03a68dd6a1bd44", + "url": "https://api.github.com/repos/utopia-php/compression/zipball/8a23fdec63623aa6ad64ed764d688e67cf2c110e", + "reference": "8a23fdec63623aa6ad64ed764d688e67cf2c110e", "shasum": "" }, "require": { @@ -3535,9 +3535,9 @@ ], "support": { "issues": "https://github.com/utopia-php/compression/issues", - "source": "https://github.com/utopia-php/compression/tree/0.1.7" + "source": "https://github.com/utopia-php/compression/tree/0.1.8" }, - "time": "2026-06-26T10:48:18+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/config", @@ -3741,16 +3741,16 @@ }, { "name": "utopia-php/di", - "version": "0.3.5", + "version": "0.3.6", "source": { "type": "git", "url": "https://github.com/utopia-php/di.git", - "reference": "053ebd097963190c5b279d66c5b530acb584d8c0" + "reference": "a72d8ee141c0883145876da95b527ffdff7ae2a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/di/zipball/053ebd097963190c5b279d66c5b530acb584d8c0", - "reference": "053ebd097963190c5b279d66c5b530acb584d8c0", + "url": "https://api.github.com/repos/utopia-php/di/zipball/a72d8ee141c0883145876da95b527ffdff7ae2a9", + "reference": "a72d8ee141c0883145876da95b527ffdff7ae2a9", "shasum": "" }, "require": { @@ -3783,9 +3783,9 @@ ], "support": { "issues": "https://github.com/utopia-php/di/issues", - "source": "https://github.com/utopia-php/di/tree/0.3.5" + "source": "https://github.com/utopia-php/di/tree/0.3.6" }, - "time": "2026-06-26T10:48:18+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/dns", @@ -4421,16 +4421,16 @@ }, { "name": "utopia-php/platform", - "version": "1.0.0-rc18", + "version": "1.0.0-rc20", "source": { "type": "git", "url": "https://github.com/utopia-php/platform.git", - "reference": "aab0b18f26cf851e8f48d6a6bb36e92ed597ce50" + "reference": "746d403d417bb8ae42e5f8d94e1bbe0e75e4c87d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/platform/zipball/aab0b18f26cf851e8f48d6a6bb36e92ed597ce50", - "reference": "aab0b18f26cf851e8f48d6a6bb36e92ed597ce50", + "url": "https://api.github.com/repos/utopia-php/platform/zipball/746d403d417bb8ae42e5f8d94e1bbe0e75e4c87d", + "reference": "746d403d417bb8ae42e5f8d94e1bbe0e75e4c87d", "shasum": "" }, "require": { @@ -4439,7 +4439,7 @@ "php": ">=8.5", "utopia-php/cli": "^0.24", "utopia-php/http": "^2.0@RC", - "utopia-php/queue": "0.23.* || 0.24.* || ^1.0.0", + "utopia-php/queue": "0.23.* || 0.24.* || ^1.0.0 || ^2.0.0", "utopia-php/servers": "^0.4" }, "type": "library", @@ -4462,22 +4462,22 @@ ], "support": { "issues": "https://github.com/utopia-php/platform/issues", - "source": "https://github.com/utopia-php/platform/tree/1.0.0-rc18" + "source": "https://github.com/utopia-php/platform/tree/1.0.0-rc20" }, - "time": "2026-08-18T15:36:41+00:00" + "time": "2026-09-04T17:01:57+00:00" }, { "name": "utopia-php/pools", - "version": "2.0.2", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/utopia-php/pools.git", - "reference": "86d43fcacd125232c0743e8c22695faf97285cf3" + "reference": "bc689b818fe1de0df72db6e51ab2f52b838b1209" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/pools/zipball/86d43fcacd125232c0743e8c22695faf97285cf3", - "reference": "86d43fcacd125232c0743e8c22695faf97285cf3", + "url": "https://api.github.com/repos/utopia-php/pools/zipball/bc689b818fe1de0df72db6e51ab2f52b838b1209", + "reference": "bc689b818fe1de0df72db6e51ab2f52b838b1209", "shasum": "" }, "require": { @@ -4518,22 +4518,22 @@ ], "support": { "issues": "https://github.com/utopia-php/pools/issues", - "source": "https://github.com/utopia-php/pools/tree/2.0.2" + "source": "https://github.com/utopia-php/pools/tree/2.1.1" }, - "time": "2026-08-05T18:07:20+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/psr7", - "version": "0.2.1", + "version": "0.2.2", "source": { "type": "git", "url": "https://github.com/utopia-php/psr7.git", - "reference": "7d3f88b9ee0b57237547eef634dbb5399b2a907e" + "reference": "cf70bec9ae4cda33bba01c8f7f2194d32adf899d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/psr7/zipball/7d3f88b9ee0b57237547eef634dbb5399b2a907e", - "reference": "7d3f88b9ee0b57237547eef634dbb5399b2a907e", + "url": "https://api.github.com/repos/utopia-php/psr7/zipball/cf70bec9ae4cda33bba01c8f7f2194d32adf899d", + "reference": "cf70bec9ae4cda33bba01c8f7f2194d32adf899d", "shasum": "" }, "require": { @@ -4564,9 +4564,9 @@ ], "support": { "issues": "https://github.com/utopia-php/psr7/issues", - "source": "https://github.com/utopia-php/psr7/tree/0.2.1" + "source": "https://github.com/utopia-php/psr7/tree/0.2.2" }, - "time": "2026-08-25T12:45:40+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/query", @@ -4619,31 +4619,31 @@ }, { "name": "utopia-php/queue", - "version": "1.5.2", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/utopia-php/queue.git", - "reference": "4cdaf1b193db4934a65720ecd3be9bf109821cfd" + "reference": "4c06e4ac7b0f478194fd8517afc285ccb7472312" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/queue/zipball/4cdaf1b193db4934a65720ecd3be9bf109821cfd", - "reference": "4cdaf1b193db4934a65720ecd3be9bf109821cfd", + "url": "https://api.github.com/repos/utopia-php/queue/zipball/4c06e4ac7b0f478194fd8517afc285ccb7472312", + "reference": "4c06e4ac7b0f478194fd8517afc285ccb7472312", "shasum": "" }, "require": { "php": ">=8.5", "utopia-php/di": "^0.3", "utopia-php/lock": "^0.3", - "utopia-php/pools": "^2.0", + "utopia-php/pools": "^2.1", "utopia-php/servers": "^0.4", "utopia-php/telemetry": "^0.4", - "utopia-php/validators": "^0.6" + "utopia-php/validators": "^0.6 || ^1.0" }, "require-dev": { "ext-redis": "*", "swoole/ide-helper": "4.8.8", - "utopia-php/nats": "^1.0.0", + "utopia-php/nats": "^1.2", "workerman/workerman": "^4.0" }, "suggest": { @@ -4679,9 +4679,9 @@ ], "support": { "issues": "https://github.com/utopia-php/queue/issues", - "source": "https://github.com/utopia-php/queue/tree/1.5.2" + "source": "https://github.com/utopia-php/queue/tree/2.0.1" }, - "time": "2026-08-28T13:38:02+00:00" + "time": "2026-09-04T18:45:16+00:00" }, { "name": "utopia-php/registry", @@ -4983,16 +4983,16 @@ }, { "name": "utopia-php/system", - "version": "0.10.5", + "version": "0.10.6", "source": { "type": "git", "url": "https://github.com/utopia-php/system.git", - "reference": "57a2ab17f5346f171c796e29a6c2202bfaa21303" + "reference": "bd8f35619c7b69360689467f25e1b608cc3ba6b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/system/zipball/57a2ab17f5346f171c796e29a6c2202bfaa21303", - "reference": "57a2ab17f5346f171c796e29a6c2202bfaa21303", + "url": "https://api.github.com/repos/utopia-php/system/zipball/bd8f35619c7b69360689467f25e1b608cc3ba6b5", + "reference": "bd8f35619c7b69360689467f25e1b608cc3ba6b5", "shasum": "" }, "require": { @@ -5028,22 +5028,22 @@ ], "support": { "issues": "https://github.com/utopia-php/system/issues", - "source": "https://github.com/utopia-php/system/tree/0.10.5" + "source": "https://github.com/utopia-php/system/tree/0.10.6" }, - "time": "2026-06-26T10:48:18+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/telemetry", - "version": "0.4.7", + "version": "0.4.8", "source": { "type": "git", "url": "https://github.com/utopia-php/telemetry.git", - "reference": "186dc1c1f92fbd15a1aa6a63515d0f4251dc88ff" + "reference": "6fb0bb579b3e249be720010bc12434c2ec6194bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/186dc1c1f92fbd15a1aa6a63515d0f4251dc88ff", - "reference": "186dc1c1f92fbd15a1aa6a63515d0f4251dc88ff", + "url": "https://api.github.com/repos/utopia-php/telemetry/zipball/6fb0bb579b3e249be720010bc12434c2ec6194bb", + "reference": "6fb0bb579b3e249be720010bc12434c2ec6194bb", "shasum": "" }, "require": { @@ -5079,9 +5079,9 @@ ], "support": { "issues": "https://github.com/utopia-php/telemetry/issues", - "source": "https://github.com/utopia-php/telemetry/tree/0.4.7" + "source": "https://github.com/utopia-php/telemetry/tree/0.4.8" }, - "time": "2026-08-26T17:59:59+00:00" + "time": "2026-09-02T15:57:19+00:00" }, { "name": "utopia-php/usage", diff --git a/src/Appwrite/Event/Certificate.php b/src/Appwrite/Event/Certificate.php index af6da47716..128780bc0b 100644 --- a/src/Appwrite/Event/Certificate.php +++ b/src/Appwrite/Event/Certificate.php @@ -3,7 +3,7 @@ namespace Appwrite\Event; use Utopia\Database\Document; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\System\System; class Certificate extends Event diff --git a/src/Appwrite/Event/Database.php b/src/Appwrite/Event/Database.php index 35bebee574..c51fcaf473 100644 --- a/src/Appwrite/Event/Database.php +++ b/src/Appwrite/Event/Database.php @@ -4,7 +4,7 @@ namespace Appwrite\Event; use Utopia\Database\Document; use Utopia\DSN\DSN; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\System\System; class Database extends Event diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 8beaeedc01..65828991ec 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -4,7 +4,7 @@ namespace Appwrite\Event; use InvalidArgumentException; use Utopia\Database\Document; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; class Event @@ -364,7 +364,7 @@ class Event $payload = array_merge($this->preparePayload(), $this->trimPayload()); try { - return $this->publisher->enqueue($queue, $payload); + return $this->publisher->publish($queue, $payload); } catch (\Throwable $th) { if ($this->critical) { throw $th; diff --git a/src/Appwrite/Event/Publisher/Audit.php b/src/Appwrite/Event/Publisher/Audit.php index d76cedccaa..8274da3249 100644 --- a/src/Appwrite/Event/Publisher/Audit.php +++ b/src/Appwrite/Event/Publisher/Audit.php @@ -4,7 +4,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Audit as AuditMessage; use Utopia\Console; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\System\System; diff --git a/src/Appwrite/Event/Publisher/Base.php b/src/Appwrite/Event/Publisher/Base.php index 2063864723..36c12ac935 100644 --- a/src/Appwrite/Event/Publisher/Base.php +++ b/src/Appwrite/Event/Publisher/Base.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Base as BaseMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Base @@ -20,7 +20,7 @@ readonly class Base { $payload = $message->toArray(); - return $this->publisher->enqueue($queue, $payload); + return $this->publisher->publish($queue, $payload); } /** diff --git a/src/Appwrite/Event/Publisher/Build.php b/src/Appwrite/Event/Publisher/Build.php index 9b2a3b68a0..2b5892b89b 100644 --- a/src/Appwrite/Event/Publisher/Build.php +++ b/src/Appwrite/Event/Publisher/Build.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Build as BuildMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Build extends Base diff --git a/src/Appwrite/Event/Publisher/Certificate.php b/src/Appwrite/Event/Publisher/Certificate.php index 472fb0d701..2ffd6df8bf 100644 --- a/src/Appwrite/Event/Publisher/Certificate.php +++ b/src/Appwrite/Event/Publisher/Certificate.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Certificate as CertificateMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Certificate extends Base diff --git a/src/Appwrite/Event/Publisher/Database.php b/src/Appwrite/Event/Publisher/Database.php index 09d5c33f03..240c37e8e3 100644 --- a/src/Appwrite/Event/Publisher/Database.php +++ b/src/Appwrite/Event/Publisher/Database.php @@ -5,7 +5,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Database as DatabaseMessage; use Utopia\Database\Document; use Utopia\DSN\DSN; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Database extends Base diff --git a/src/Appwrite/Event/Publisher/Delete.php b/src/Appwrite/Event/Publisher/Delete.php index fb3b46c647..d28b241918 100644 --- a/src/Appwrite/Event/Publisher/Delete.php +++ b/src/Appwrite/Event/Publisher/Delete.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Delete as DeleteMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Delete extends Base diff --git a/src/Appwrite/Event/Publisher/Execution.php b/src/Appwrite/Event/Publisher/Execution.php index 27c2816184..86bf4e756d 100644 --- a/src/Appwrite/Event/Publisher/Execution.php +++ b/src/Appwrite/Event/Publisher/Execution.php @@ -5,7 +5,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Execution as ExecutionMessage; use Appwrite\Event\Message\ExecutionCancelled as ExecutionCancelledMessage; use Appwrite\Event\Message\Executions as ExecutionsMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Execution extends Base diff --git a/src/Appwrite/Event/Publisher/Func.php b/src/Appwrite/Event/Publisher/Func.php index 46f748a59f..24015093be 100644 --- a/src/Appwrite/Event/Publisher/Func.php +++ b/src/Appwrite/Event/Publisher/Func.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Func as FunctionMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Func extends Base diff --git a/src/Appwrite/Event/Publisher/Jobs.php b/src/Appwrite/Event/Publisher/Jobs.php index 3da9d635bf..45dd15b5d8 100644 --- a/src/Appwrite/Event/Publisher/Jobs.php +++ b/src/Appwrite/Event/Publisher/Jobs.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Jobs as JobsMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Jobs extends Base diff --git a/src/Appwrite/Event/Publisher/Mail.php b/src/Appwrite/Event/Publisher/Mail.php index 16d48be044..7d756c5ebe 100644 --- a/src/Appwrite/Event/Publisher/Mail.php +++ b/src/Appwrite/Event/Publisher/Mail.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Mail as MailMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Mail extends Base diff --git a/src/Appwrite/Event/Publisher/Messaging.php b/src/Appwrite/Event/Publisher/Messaging.php index 69863566a1..627ffce317 100644 --- a/src/Appwrite/Event/Publisher/Messaging.php +++ b/src/Appwrite/Event/Publisher/Messaging.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Messaging as MessagingMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Messaging extends Base diff --git a/src/Appwrite/Event/Publisher/Migration.php b/src/Appwrite/Event/Publisher/Migration.php index fc455a7e95..01d481d874 100644 --- a/src/Appwrite/Event/Publisher/Migration.php +++ b/src/Appwrite/Event/Publisher/Migration.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Migration as MigrationMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Migration extends Base diff --git a/src/Appwrite/Event/Publisher/Notification.php b/src/Appwrite/Event/Publisher/Notification.php index 2fe0353276..6e609166a5 100644 --- a/src/Appwrite/Event/Publisher/Notification.php +++ b/src/Appwrite/Event/Publisher/Notification.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Notification as NotificationMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Notification extends Base diff --git a/src/Appwrite/Event/Publisher/Screenshot.php b/src/Appwrite/Event/Publisher/Screenshot.php index 2a0fa1e0f8..e298fcff2b 100644 --- a/src/Appwrite/Event/Publisher/Screenshot.php +++ b/src/Appwrite/Event/Publisher/Screenshot.php @@ -3,7 +3,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Screenshot as ScreenshotMessage; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; readonly class Screenshot extends Base diff --git a/src/Appwrite/Event/Publisher/StatsResources.php b/src/Appwrite/Event/Publisher/StatsResources.php index 73002e5b0f..5203b69027 100644 --- a/src/Appwrite/Event/Publisher/StatsResources.php +++ b/src/Appwrite/Event/Publisher/StatsResources.php @@ -4,7 +4,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\StatsResources as StatsResourcesMessage; use Utopia\Console; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\System\System; diff --git a/src/Appwrite/Event/Publisher/Usage.php b/src/Appwrite/Event/Publisher/Usage.php index fc3ac6362e..cf82ea8a0d 100644 --- a/src/Appwrite/Event/Publisher/Usage.php +++ b/src/Appwrite/Event/Publisher/Usage.php @@ -4,7 +4,7 @@ namespace Appwrite\Event\Publisher; use Appwrite\Event\Message\Usage as UsageMessage; use Utopia\Console; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\System\System; diff --git a/src/Appwrite/Event/Webhook.php b/src/Appwrite/Event/Webhook.php index 5cd773a18f..3fcfbd7a45 100644 --- a/src/Appwrite/Event/Webhook.php +++ b/src/Appwrite/Event/Webhook.php @@ -2,7 +2,7 @@ namespace Appwrite\Event; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\System\System; class Webhook extends Event diff --git a/src/Appwrite/Platform/Tasks/QueueRetry.php b/src/Appwrite/Platform/Tasks/QueueRetry.php index cd92ad8307..cdc93c655d 100644 --- a/src/Appwrite/Platform/Tasks/QueueRetry.php +++ b/src/Appwrite/Platform/Tasks/QueueRetry.php @@ -4,7 +4,7 @@ namespace Appwrite\Platform\Tasks; use Utopia\Console; use Utopia\Platform\Action; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; use Utopia\Validator\Text; use Utopia\Validator\Wildcard; diff --git a/tests/e2e/General/WorkerConcurrencyTest.php b/tests/e2e/General/WorkerConcurrencyTest.php index c95e49363a..5b742b9796 100644 --- a/tests/e2e/General/WorkerConcurrencyTest.php +++ b/tests/e2e/General/WorkerConcurrencyTest.php @@ -73,8 +73,8 @@ final class WorkerConcurrencyTest extends TestCase $pendingDuringFirstMessage = null; \Swoole\Coroutine\run(function () use ($broker, $queue, &$processed, &$pendingDuringFirstMessage): void { - $broker->enqueue($queue, ['n' => 0]); - $broker->enqueue($queue, ['n' => 1]); + $broker->publish($queue, ['n' => 0]); + $broker->publish($queue, ['n' => 1]); $adapter = new Swoole($broker, 1, self::NAMESPACE); @@ -133,7 +133,7 @@ final class WorkerConcurrencyTest extends TestCase foreach ($queues as $spec) { $queue = new Queue($spec['name'], self::NAMESPACE); for ($i = 0; $i < $spec['messages']; $i++) { - $broker->enqueue($queue, ['n' => $i]); + $broker->publish($queue, ['n' => $i]); } $specs[] = ['queue' => $queue, 'maxCoroutines' => $spec['maxCoroutines']]; } diff --git a/tests/unit/Event/MockPublisher.php b/tests/unit/Event/MockPublisher.php index 716692a54a..3f2c987ae5 100644 --- a/tests/unit/Event/MockPublisher.php +++ b/tests/unit/Event/MockPublisher.php @@ -2,14 +2,14 @@ namespace Tests\Unit\Event; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; class MockPublisher implements Publisher { private array $events = []; - public function enqueue(Queue $queue, array $payload, bool $priority = false): bool + public function publish(Queue $queue, array $payload, bool $priority = false): bool { if (!isset($this->events[$queue->name])) { $this->events[$queue->name] = []; @@ -21,7 +21,7 @@ class MockPublisher implements Publisher public function enqueueMany(Queue $queue, array $payloads, bool $priority = false): bool { foreach ($payloads as $payload) { - $this->enqueue($queue, $payload, $priority); + $this->publish($queue, $payload, $priority); } return true; diff --git a/tests/unit/Platform/Workers/MigrationsTest.php b/tests/unit/Platform/Workers/MigrationsTest.php index 40b0e2d8a3..48e10f13ab 100644 --- a/tests/unit/Platform/Workers/MigrationsTest.php +++ b/tests/unit/Platform/Workers/MigrationsTest.php @@ -16,7 +16,7 @@ use Utopia\Database\Validator\Authorization; use Utopia\Migration\Destination; use Utopia\Migration\Resource; use Utopia\Migration\Source; -use Utopia\Queue\Publisher; +use Utopia\Queue\Publisher\Synchronous as Publisher; use Utopia\Queue\Queue; final class MigrationsTest extends TestCase