Use something like "lightweight monadic regions" to handle iteratee cleanup #99

Closed
gregorycollins opened this Issue Sep 28, 2011 · 0 comments

Comments

Projects
None yet
2 participants
@gregorycollins
Owner

gregorycollins commented Sep 28, 2011

Currently with the enumerator package, there is no way to ensure that resources opened by iteratees are cleaned up if the enumerator fails (e.g. "connection closed by peer" on the read socket). We are forced to use ugly workaround hacks like MVar finalizers to deal with this.

Oleg's lightweight monadic regions paper contains a generic technique for dealing with this problem; we don't necessarily have to go to RegionT, but an IORef-based "resource manager" could help here.

@mightybyte mightybyte closed this Aug 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment