問題タブ [swoole]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
swoole - RedisPool を使用して、Swoole WebSocket で複数の Redis 接続を管理する方法
Swoole Websocket サーバーがあり、RedisPool を使用して複数の Redis 接続を管理し、メッセージを受信したときにクエリごとに 1 つを選択したいと考えています。RedisPool から接続を取得しようとすると、Swoole が「Error: Uncaught Swoole\Error: API must be called in the coroutine in @swoole-src/library/core/ConnectionPool.php:69」というエラーを出力するので、試してみました。クエリを Co\Run でカプセル化するには:
次に、「警告: Swoole\Coroutine\Scheduler::start(): eventLoop は既に作成されています。Swoole\Coroutine\Scheduler を開始できません」というメッセージが表示されます。
websocket サーバーによって eventLoop が既に開始されていると思います。サーバーの eventLoop にアクセスする方法や、コルーチンを実行する別の方法はありますか?