From 602698aeb2aed1d148d137e33fad6fdb80c43144 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Wed, 8 May 2024 10:29:35 +0100 Subject: [PATCH] wip --- .../Pusher/PusherPubSubIncomingMessageHandler.php | 1 + src/Servers/Reverb/Publishing/RedisPubSubProvider.php | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) 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); + })); } /**