Closed respire closed 7 years ago
hi @respire thanks, i believe i understand the issue. the purpose of the on_close was to do cleanup on the stashes so that the next iteration wouldn't have to; in that sense, the proc would probably retain scope of the responder, and this wouldn't get us anything. it took me a second to notice that you're only adding to the list if on_close is set, i like that.
happy to merge if you would be willing to add a test or two around it?
thanks @kenichi ! of course I would love to add some specs on it. one thing, can you provide some actual scenario or case to use the on_close? actually, i'm not so understand what it's to clean up. maybe I can try to optimize the memory footprint of the on_close if I know what it did
please see #74 which i think it's a better solution
Description: after each request, server will push responder into an array. if connection is alive for a long time, responders and objects they refer to won't be recycled by GC, which may result in out of memory issue.
Solution: push Proc instead of responder if on_close block defined.