haskell-capnp
haskell-capnp copied to clipboard
Make async-exception-safe resource acquisition easier.
Right now, the way the export_* functions work, it's somewhat annoying to correctly acquire resources and then export them in a way that is async-exception safe; export_* attaches the lifetime of the thread it spawns to a supervisor, but if the server itself contains resources, it's difficult to acquire those resources and not be at risk of leaking them if an async exception is thrown between then and the call to export.
We should tweak the design of the API to make this easier to do correctly.