text=Hello%21+I%E2%80%99m+your+English+teacher%2CDo+you+have+an+English+name%3FWhat%E2%80%99s+your+English+name%3F&voice_name=girl_bianca.mp3&text_language=en
PHP Deprecated: long2ip(): Passing null to parameter #1 ($ip) of type int is deprecated in /Users/wheng/phpDevelopment/UtalkLearn/vendor/workerman/gateway-worker/src/Lib/Gateway.php on line 1128
Deprecated: long2ip(): Passing null to parameter #1 ($ip) of type int is deprecated in /Users/wheng/phpDevelopment/UtalkLearn/vendor/workerman/gateway-worker/src/Lib/Gateway.php on line 1128
老大说 可以 开 32 个。
调用 api 建议用 https://www.workerman.net/plugin/157
openai 用 https://www.workerman.net/plugin/157 来调用,是非阻塞的。
businessWorker可以开成cpu的3-8倍。不能无限大。
POST /api.php HTTP/1.1
Host: tts-dev.testhost.com:8054
User-Agent: workerman/http-client
Connection: keep-alive
0: Content-Type: application/json
1: Authorization:
Content-Type: application/x-www-form-urlencoded
Content-Length: 158
text=Hello%21+I%E2%80%99m+your+English+teacher%2CDo+you+have+an+English+name%3FWhat%E2%80%99s+your+English+name%3F&voice_name=girl_bianca.mp3&text_language=en
PHP Deprecated: long2ip(): Passing null to parameter #1 ($ip) of type int is deprecated in /Users/wheng/phpDevelopment/UtalkLearn/vendor/workerman/gateway-worker/src/Lib/Gateway.php on line 1128
Deprecated: long2ip(): Passing null to parameter #1 ($ip) of type int is deprecated in /Users/wheng/phpDevelopment/UtalkLearn/vendor/workerman/gateway-worker/src/Lib/Gateway.php on line 1128
不知道为啥,我 在 gateway-worker 里的业务代码 调用 Workerman\Http\Client 发送一个 异步请求,会牵扯到
这个错误
"require": {
"workerman/gateway-worker": "^3.1",
"symfony/yaml": "^6.3",
"workerman/redis-queue": "^1.1",
"james-heinrich/getid3": "^1.9",
"php-amqplib/php-amqplib": "^3.6",
"predis/predis": "^2.2",
"react/promise": "^3.0",
"overtrue/pinyin": "^5.3",
"workerman/http-client": "^2.2"
}
这是项目依赖
http接口里是不是调用了Gateway相关的方法,并且参数应该是传错了
http 接口异步返回数据, 调用Gateway::sendToCurrentClient($message); 给当前用户反馈消息, 就出发这个错误了。
我把 Gateway::sendToCurrentClient($message); 改成 Gateway::sendToClient(getClientId(), $message);
能凑合用了,但是这里肯定有BUG。
异步环境不支持调用sendToCurrentClient(),因为当前客户端可能已经变化
另外sendToCurrentClient()已经从手册删除了,不建议调用了