Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Swoole\ Table in hyperf

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to use Swoole\ Table in hyperf. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

The create of Swoole\ Table needs to precede workStart, so configure SwooleEvent::ON_BEFORE_START listening events in server.php before the tcp service starts.

['name' = >' tcp', 'type' = > Server::SERVER_BASE,' host' = > '0.0.0.0', 'port' = > 9503,' sock_type' = > SWOOLE_SOCK_TCP, 'callbacks' = > [SwooleEvent::ON_BEFORE_START = > [\ App\ Tcp\ ServerStartCallback::class,' beforeStart'] SwooleEvent::ON_WORKER_START = > [\ App\ Tcp\ TcpServer::class, 'onWorkerStart'], SwooleEvent::ON_CONNECT = > [\ App\ Tcp\ TcpServer::class,' onConnect'], SwooleEvent::ON_RECEIVE = > [\ App\ Tcp\ TcpServer::class, 'onReceive'],]]

Initialization of Swoole\ Table in ServerStartCallback

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report