Hi -
I have a background worker that uses a streaming API. I am just simply using nodejs fetch
and then using response.body.getReader()
to accomplish this.
It works great - but I have recently received feedback that the stream never appears to properly disconnect.
This is concerning, as I did set up a nodeCleanup
behavior using the node-cleanup npm package node-cleanup - npm, which should iterate through any open readers and call reader.close()
HOWEVER - reader.close()
is an async call, and nodeCleanup’s function is called synchronously… so possibly that is the problem I think
I know that with render’s zero-downtime it’s a bit mysterious when one process ends and another begins - but is there some other option within render to have an old process call some methods (preferrably async) when the process is ending? Perhaps some event fired within node I can attach to?
Thanks in advance