Skip to content

client pool app #1966

Answered by fakeshadow
jwinarske asked this question in Q&A
Feb 8, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I don't think you can gain anything from a stand alone client pool for awc.

When using a pool for client you mostly aiming to reuse TcpStream for specific domain/socket address and in awc this happens only on single thread. Which means you can not really share one TcpStream across threads and it stays on the thread you establish that stream. (There is no public API to move a stream between threads in awc and even if you can the underlying event is still polled by the runtime it's registered).

I would suggest you use reqwest for a thread safe approach where you share a unified stream pool.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jwinarske
Comment options

Answer selected by robjtede
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants