Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for review #1

Open
brandonchinn178 opened this issue Nov 23, 2020 · 1 comment
Open

Request for review #1

brandonchinn178 opened this issue Nov 23, 2020 · 1 comment

Comments

@brandonchinn178
Copy link
Owner

This is a super small library, but I think it's helpful enough to have as a separate library. resource-pool and resourcet probably don't want to incur a dependency on the other (which makes sense to me), and I was searching Hackage for a way to use withAcquire with a Pool. Providing this library would provide a quick solution if one ends up in this situation.

For me personally, I would like to use withAcquire because it uses MonadUnliftIO, whereas withResource uses MonadBaseControl (see bos/pool#31 and bos/pool#37). But I'm sure there are other situations where this might be useful (e.g. using a Pool within the MonadResource context)

I mostly copied from persistent's code here:

https://github.com/yesodweb/persistent/blob/9e6d88d767035d3e62252666ab3083ab576257bf/persistent/Database/Persist/Sql/Run.hs#L33-L45

I would love a quick review from the maintainers of these packages, to check:

  1. That there isn't already implemented somewhere
  2. That I'm handling it correctly (accounting for errors and such)

Many thanks in advance!

cc @bos @snoyberg

@snoyberg
Copy link

Overall seems sensible to me. There may be some place that this logic already exists, but I can't think of it off the top of my head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants