-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
运行环境为最新的 workerman/5.1 和 webman 框架, eventloop 采用 PHP8 自带的 Fiber
协程模式。
尝试根据官网连接池文档示例编写连接池去支持 amphp/redis, amphp/mysql 这些异步客户端,当并发数超过 max_connections 会在归还连接时抛出以下错误:
FiberError: Cannot switch fibers in current execution context
这个情况初步判断是因为 Coroutine::defer() 归还连接的调用发生在析构函数,异步客户端的纤程切换导致了异常。
示例代码我就不贴了,估计作者一看便知。