Closed darrenldl closed 1 year ago
Thanks for feedback! I'll revisit this PR in a few weeks.
@darrenldl: In #602 I've made a lock-free pool using the Cells module. I think the extra features of this PR (e.g. the monitor fiber) could probably be built on top of that - would that work for your use?
@talex5 The monitor is just there to make sure if some acquired resources have become unusable after use or an exception occurred during use, the pool is filled back in. But I think the validate
code and exception handling in your run_with
fulfills that role already.
I think your version (along with the simpler API) is good - this PR mainly tried to match Lwt pool features, some of which might not be that usable in practice to begin with.
Thanks for adding Eio.Pool
!
Split from #517 to focus on just resource pool