@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * @return void |
| 17 | 17 | */ |
| 18 | 18 | public function setConsumers(array $consumers): void { |
| 19 | - $this->consumers = $consumers; |
|
| 19 | + $this->consumers = $consumers; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | { |
| 7 | 7 | |
| 8 | 8 | public function handle($payload) { |
| 9 | - echo 'привет я Demo Consumer - ' . $payload; |
|
| 9 | + echo 'привет я Demo Consumer - ' . $payload; |
|
| 10 | 10 | } |
| 11 | 11 | } |
| 12 | 12 | \ No newline at end of file |
@@ -45,11 +45,11 @@ |
||
| 45 | 45 | |
| 46 | 46 | $this->tcpServer = new \React\Socket\TcpServer($ip . ':' . $port); |
| 47 | 47 | |
| 48 | - $this->tcpServer->on('connection', function (ConnectionInterface $connection) { |
|
| 48 | + $this->tcpServer->on('connection', function(ConnectionInterface $connection) { |
|
| 49 | 49 | |
| 50 | 50 | $connection->pipe($connection); |
| 51 | 51 | |
| 52 | - $connection->on('data', function ($payload) { |
|
| 52 | + $connection->on('data', function($payload) { |
|
| 53 | 53 | foreach ($this->consumers as $consumer) { |
| 54 | 54 | $consumer->handle($payload); |
| 55 | 55 | } |