haskell-capnp icon indicating copy to clipboard operation
haskell-capnp copied to clipboard

Make async-exception-safe resource acquisition easier.

Open zenhack opened this issue 4 years ago • 0 comments

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.

zenhack avatar Dec 14 '20 12:12 zenhack