diff --git a/src/Protocols/Pusher/PusherPubSubIncomingMessageHandler.php b/src/Protocols/Pusher/PusherPubSubIncomingMessageHandler.php index 55db23e3..1c3ead09 100644 --- a/src/Protocols/Pusher/PusherPubSubIncomingMessageHandler.php +++ b/src/Protocols/Pusher/PusherPubSubIncomingMessageHandler.php @@ -12,6 +12,7 @@ class PusherPubSubIncomingMessageHandler implements PubSubIncomingMessageHandler */ public function handle(string $payload): void { + dump($payload); $event = json_decode($payload, associative: true, flags: JSON_THROW_ON_ERROR); $application = unserialize($event['application']); diff --git a/src/Servers/Reverb/Publishing/RedisPubSubProvider.php b/src/Servers/Reverb/Publishing/RedisPubSubProvider.php index 614f9e15..933b347a 100644 --- a/src/Servers/Reverb/Publishing/RedisPubSubProvider.php +++ b/src/Servers/Reverb/Publishing/RedisPubSubProvider.php @@ -51,11 +51,10 @@ public function subscribe(): void { $this->ensureConnected(); - $this->subscribingClient->subscribe($this->channel); - - $this->subscribingClient->on('message', function (string $channel, string $payload) { - $this->messageHandler->handle($payload); - }); + $this->subscribingClient->subscribe($this->channel) + ->then(fn () => $this->subscribingClient->on('message', function (string $channel, string $payload) { + $this->messageHandler->handle($payload); + })); } /**