yinebebt/wspool ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go package for using WebSocket connections with a pool, so my app can reuse connections instead of opening a new one every time. I want to be able to set a minimum and maximum number of connections, control how long connections live, close idle ones, and have the pool adjust itself based on traffic. It should be safe to use from multiple goroutines at once.

I also want a simple way to grab a connection, send a message, read the reply, and then return it to the pool when I am done. Please include a clean example showing how to create the pool, connect to a WebSocket URL, use a connection, and shut everything down properly. If you need to check current docs for the WebSocket client being used, feel free to look them up online.

Are you gonna build this?

make sure you review the code using arcumet

Try freeSponsored — opens Arcumet in a new tab