Skip to content
New issue

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

http client是不是不能多线程同时调用,不同的对象。 #864

Open
2 tasks
hujiongqazqq opened this issue Dec 20, 2024 · 2 comments
Open
2 tasks

Comments

@hujiongqazqq
Copy link

Search before asking

  • I searched the issues and found no similar issues.

What happened + What you expected to happen

Reproduction way

Anything else

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!
@poor-circle
Copy link
Collaborator

是的,目前暂时没支持http2,所以设计上请求是同步阻塞的,不支持多请求同时并发。如有需要你可以自己加锁。

不过,更推荐使用client_pool和load_blancer来多线程调用。具体使用请见example代码。

@hujiongqazqq
Copy link
Author

coro_http::coro_http_client client(coro_io::get_global_executor(1));
auto res = client.get(url.c_str());
我这样调用暂时没发现问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants