Cohttp_lwt_unix recently added an on_exn hook: https://github.com/mirage/ocaml-cohttp/pull/518/files which might be a useful addition to Opium. The use case I have in mind is long polling, where the Opium_rock.Service is a long-running Lwt thread. If the client closes the connection, that thread should be cancelled.
I could probably manage a PR, but it would change some module signatures so I thought I would check with you first. Would you be open to exposing on_exn, and if so where?
Cohttp_lwt_unix recently added an on_exn hook: https://github.com/mirage/ocaml-cohttp/pull/518/files which might be a useful addition to Opium. The use case I have in mind is long polling, where the Opium_rock.Service is a long-running Lwt thread. If the client closes the connection, that thread should be cancelled.
I could probably manage a PR, but it would change some module signatures so I thought I would check with you first. Would you be open to exposing on_exn, and if so where?