File tree Expand file tree Collapse file tree 2 files changed +42
-52
lines changed
Expand file tree Collapse file tree 2 files changed +42
-52
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Listeners ;
4+
5+ use App \Events \SpeedtestCompleted ;
6+ use App \Events \SpeedtestFailed ;
7+ use App \Jobs \Influxdb \v2 \WriteResult ;
8+ use App \Settings \DataIntegrationSettings ;
9+ use Illuminate \Events \Dispatcher ;
10+
11+ class DataIntegrationSubscriber
12+ {
13+ /**
14+ * Create the event listener.
15+ */
16+ public function __construct (
17+ public DataIntegrationSettings $ settings ,
18+ ) {}
19+
20+ /**
21+ * Handle the event.
22+ */
23+ public function handle (object $ event ): void
24+ {
25+ if ($ this ->settings ->influxdb_v2_enabled ) {
26+ WriteResult::dispatch ($ event ->result );
27+ }
28+ }
29+
30+ /**
31+ * Register the listeners for the subscriber.
32+ *
33+ * @return array<string, string>
34+ */
35+ public function subscribe (Dispatcher $ events ): array
36+ {
37+ return [
38+ SpeedtestCompleted::class => 'handleSpeedtestCompleted ' ,
39+ SpeedtestFailed::class => 'handleSpeedtestFailed ' ,
40+ ];
41+ }
42+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments