From 59db45341338426876caa689e6a633c9a59e0398 Mon Sep 17 00:00:00 2001 From: Valeriu Vodnicear Date: Sun, 31 Mar 2019 01:15:35 +0200 Subject: [PATCH 1/3] change minimal version php and laravel --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fc49176..ab57cdcb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Laravel-Swoole -![php-badge](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg) +![php-badge](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg) [![packagist-badge](https://img.shields.io/packagist/v/swooletw/laravel-swoole.svg)](https://packagist.org/packages/swooletw/laravel-swoole) [![Total Downloads](https://poser.pugx.org/swooletw/laravel-swoole/downloads)](https://packagist.org/packages/swooletw/laravel-swoole) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/swooletw/laravel-swoole/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/swooletw/laravel-swoole/?branch=master) @@ -12,7 +12,7 @@ This package provides a high performance HTTP server to speed up your Laravel/Lu | PHP | Laravel | Lumen | Swoole | |:-------:|:-------:|:-----:|:-------:| -| >=7.2 | ~5.4 | ~5.4 | >=4.0.0 | +| >=7.2 | ~5.8 | ~5.4 | >=4.0.0 | ## Features From 04ffc0506b0294b9c94a1b8972f01deba42e4131 Mon Sep 17 00:00:00 2001 From: Muhammad Abdul Azim <42019012+mabdulazim@users.noreply.github.com> Date: Sun, 31 Mar 2019 13:38:11 +0200 Subject: [PATCH 2/3] Update message attribute datatype in Pusher.php update message attribute datatype to mixed rather than string to send json object as the data --- src/Websocket/Pusher.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Websocket/Pusher.php b/src/Websocket/Pusher.php index cad25f47..a6ec1880 100644 --- a/src/Websocket/Pusher.php +++ b/src/Websocket/Pusher.php @@ -45,7 +45,7 @@ class Pusher protected $event; /** - * @var string|null + * @var mixed|null */ protected $message; @@ -58,7 +58,7 @@ class Pusher * @param bool $broadcast * @param bool $assigned * @param string $event - * @param string|null $message + * @param mixed|null $message * @param \Swoole\Websocket\Server */ protected function __construct( @@ -68,7 +68,7 @@ protected function __construct( bool $broadcast, bool $assigned, string $event, - string $message = null, + $message = null, $server ) { @@ -189,9 +189,9 @@ public function getEvent(): string } /** - * @return string|null + * @return mixed|null */ - public function getMessage(): ?string + public function getMessage() { return $this->message; } @@ -278,4 +278,4 @@ public function push($payload): void } } } -} \ No newline at end of file +} From 0bcc42caa73ed42301349b94e803247d76d51de6 Mon Sep 17 00:00:00 2001 From: Sascha-Oliver Prolic Date: Tue, 9 Apr 2019 11:39:43 +0800 Subject: [PATCH 3/3] Fix Server Manager `SwooleTaskJob` has a `fire()` method, not a `dispatch()` method. --- src/Server/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Server/Manager.php b/src/Server/Manager.php index 4258a707..634e4b81 100644 --- a/src/Server/Manager.php +++ b/src/Server/Manager.php @@ -271,7 +271,7 @@ public function onTask($server, $taskId, $srcWorkerId, $data) $this->pushMessage($server, $data['data']); // push async task to queue } elseif ($this->isAsyncTaskPayload($data)) { - (new SwooleTaskJob($this->container, $server, $data, $taskId, $srcWorkerId))->dispatch(); + (new SwooleTaskJob($this->container, $server, $data, $taskId, $srcWorkerId))->fire(); } } catch (Throwable $e) { $this->logServerError($e);