Anything like object-pool in futures crate?

Hey, guys!

I have an app runs in with futures crate. I wanna have something like object-pool (or connection-pool) to limit parallel access to some internal resource. This may look like waiting on the pool's future and when there is one object/connection become available (saying, returned by other future to the poll), the parked future should be notified and executed. There are queue-like utils in futures, maybe I could wait on the Stream of the queue but I don't know how to just get a single one from it.

But I didn't find anything like that. Do you know any?

This can be done with semaphore in tokio-sync: tokio_sync::semaphore - Rust

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.