scrive / pool

A high-performance striped resource pooling implementation for Haskell
Other
18 stars 11 forks source link

Implement timeout variants #22

Open parsonsmatt opened 1 year ago

parsonsmatt commented 1 year ago

Based on #21

Fixes #10

goosedb commented 1 year ago

@parsonsmatt I think implementing timeouts this way is not very good idea. There are many libraries use pool, so there are many cases you create pool used by external library. But a library author don't (and, maybe, shouldn't?) think whether to use with timeout version or basic one. So I think you should be able to inject timeout inside of pool.

Update: Because of reasons I've written above my issue #10 is not solved by this PR (because I don't have access to code which takes resource.) And also your PR can be implemented in beyond of the library. It's just a sugar for existing interface. So in my PR #11 I added new feature allows to inject timeout, which can't be implemented beyond.