[Ur] FFI - initialization and shutdown logic for third-party modules

Adam Chlipala adamc at csail.mit.edu
Tue Apr 5 08:32:26 EDT 2016


On 04/05/2016 07:56 AM, foldr at tutanota.com wrote:
> Is there any mechanism to reliably initialize a third-party library on 
> Ur/Web application startup and de-initialize it (once only!) on 
> application shutdown?
>
> I probably can use [initialize] task in the beginning, but I need to 
> ensure that it completes before any requests are processed by the 
> application - can I rely on that?

Yes, it's guaranteed that [initialize] task code finishes before any 
requests are handled.

> I have not found anything similar for shutdown de-initialization.

No one asked for that kind of task yet, but it might not be too hard to add.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20160405/f039f2db/attachment.html>


More information about the Ur mailing list