-
Notifications
You must be signed in to change notification settings - Fork 29
Use ZIO's Managed to handle cleaning resources #42
Comments
it sounds very reasonable to me! I'm wondering how well it will be aligned with our general |
The I got the idea watching this talk: https://speakerdeck.com/iravid/boring-usecases-for-exciting-types?slide=53 (ZIO and Managed are mentioned at the end). |
Hi @ghostdogpr, thank you for the link! |
Yeah, it makes sense to allow both. This one could just be a helper method in the companion object. I’ll work on a PR. |
@ghostdogpr, thanks a lot! |
@ghostdogpr you can as well join our gitter channel |
How about using
Managed
from ZIO to avoid having users (forgetting) invokeclose
explicitly?For example:
Then when using it:
Or if we want to keep the wrapper API low-level, there could be another higher-level API that does something like that:
where the
acquire
operation would create the channel and call bind, and therelease
operation would close it.How do you think?
The text was updated successfully, but these errors were encountered: