This commit is contained in:
2021-08-05 16:56:42 +08:00
parent 859e2c7717
commit 6d4b352c30
2 changed files with 7 additions and 10 deletions
+4 -8
View File
@@ -3,6 +3,7 @@
namespace Server\Manager;
use Annotation\Inject;
use Kafka\Message;
use Server\Abstracts\Server;
use Server\Constant;
use Exception;
@@ -33,14 +34,9 @@ class OnPipeMessage extends Server
if (!is_object($message) || !($message instanceof PipeMessage)) {
return;
}
defer(fn() => $this->eventDispatch->dispatch(new OnAfterRequest()));
$this->runEvent(Constant::PIPE_MESSAGE,
function (\Swoole\Server $server, $src_worker_id, $message) {
call_user_func([$message, 'execute']);
}, [
$server, $src_worker_id, $message
]
);
call_user_func([$message, 'process'], $server, $src_worker_id);
$this->eventDispatch->dispatch(new OnAfterRequest());
}