We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,我使用了EventLoopThreadPool 来做多线程异步http请求
我看到执行的时候需要调用EventLoopThreadPool 的start方法
void EventLoopThreadPool::start() { for (unsigned int i = 0; i < loopThreadVector_.size(); ++i) { loopThreadVector_[i]->run(); } }
但是看到源码里面需要把threadvector里面所有的loop 执行一遍
可以指定loop执行吗?
The text was updated successfully, but these errors were encountered:
这个循环是把所有loop都跑起来,否则这个pool没法执行任何task,如果你只需要用一个loop,应该考虑直接用EventLoopThread
Sorry, something went wrong.
您好,我的场景是这样:
我最多的时候需要同时执行4个http请求(间隔很小),假设每个请求的延迟都是100ms,我希望他们是最快执行(100ms左右执行完4个请求),没有任何阻塞,所以,我的做法是:
创建四个httpclientptr,每个绑定一个EventLoopThread
每个请求到达的时候,我都会调用EventLoopThread的start方法
但是start的方法是全局调用pool里面所有的loop, 但我希望能精准调用
比如,请求1使用了HttpClientPtr1(绑定了loop1),我希望只调用loop1的执行,loop2-loop4其实没有任务
start一次就行了,我记得有个接口传index获取loop吧
No branches or pull requests
您好,我使用了EventLoopThreadPool 来做多线程异步http请求
我看到执行的时候需要调用EventLoopThreadPool 的start方法
但是看到源码里面需要把threadvector里面所有的loop 执行一遍
可以指定loop执行吗?
The text was updated successfully, but these errors were encountered: