Dyalog / Jarvis

APL-based web service framework supporting JSON or REST
https://dyalog.github.io/Jarvis/
MIT License
33 stars 6 forks source link

Provide setting to kill request-handling thread on connection close #57 #58

Closed bpbecker closed 6 months ago

bpbecker commented 7 months ago

Adds KillOnDisconnect field to the Request object. Default is 0 (which emulates the previous behavior).

The use case for this feature is when you have a long-running endpoint and the client connection closes unexpectedly. Normally, the endpoint would continue to run, possibly blocking other requests (depending on if/how holds are used). Setting req.KillOnRequest←1 will kill the thread that's running the endpoint if the client connection closes. This can be set on an endpoint by endpoint basis.