From b905c15010289df510232e92fb011112ba9a13cb Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Wed, 8 May 2024 20:09:06 +0100 Subject: [PATCH] wip --- src/Protocols/Pusher/MetricsHandler.php | 6 ------ src/Servers/Reverb/Publishing/RedisPubSubProvider.php | 3 --- .../Protocols/Pusher/Reverb/ChannelControllerTest.php | 1 - 3 files changed, 10 deletions(-) diff --git a/src/Protocols/Pusher/MetricsHandler.php b/src/Protocols/Pusher/MetricsHandler.php index 59c4fd70..18485a06 100644 --- a/src/Protocols/Pusher/MetricsHandler.php +++ b/src/Protocols/Pusher/MetricsHandler.php @@ -141,15 +141,12 @@ protected function gatherMetricsFromSubscribers(Application $application, string */ protected function requestMetricsFromSubscribers(Application $application, string $key, string $type, ?array $options): void { - dump('Requesting metrics from subscribers using '.$key); - $this->pubSubProvider->publish([ 'type' => 'metrics', 'key' => $key, 'application' => serialize($application), 'payload' => ['type' => $type, 'options' => $options], ])->then(function ($total) { - dump('Total subscribers: '.$total); $this->subscribers = $total; }); } @@ -211,12 +208,9 @@ protected function mergeChannels(array $metrics): array */ protected function listenForMetrics(string $key): Deferred { - dump('Listenting on '.$key); - $deferred = new Deferred; $this->pubSubProvider->on('metrics-retrieved', function ($payload) use ($key, $deferred) { - dump('Metrics received for '.$key); if ($payload['key'] !== $key) { return; } diff --git a/src/Servers/Reverb/Publishing/RedisPubSubProvider.php b/src/Servers/Reverb/Publishing/RedisPubSubProvider.php index 844801a6..614f9e15 100644 --- a/src/Servers/Reverb/Publishing/RedisPubSubProvider.php +++ b/src/Servers/Reverb/Publishing/RedisPubSubProvider.php @@ -63,16 +63,13 @@ public function subscribe(): void */ public function on(string $event, callable $callback): void { - dump('Listening from provider...'); $this->subscribingClient->on('message', function (string $channel, string $payload) use ($event, $callback) { - dump($payload); $payload = json_decode($payload, associative: true, flags: JSON_THROW_ON_ERROR); if (($payload['type'] ?? null) === $event) { $callback($payload); } }); - dump('Listening from provider...done'); } /** diff --git a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php index 9c86768a..ea810525 100644 --- a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php @@ -69,7 +69,6 @@ }); it('can gather data for a single channel', function () { - dump('Testing Redis'); $this->usingRedis(); subscribe('test-channel-one');