planthaber/rock-webapp — pull request #6 by planthaber (2014-09-03 11:39:33+00:00)
Title: keep references of ports and writers and remove them only after a timeout

The GC can collect them any time after the timeout.

Hopefully solves this Issue https://github.com/planthaber/rock-webapp/issues/2

I opted for two things:

1. The timeout parameter to be a GET param (inside the url ../port/write?timeout=30).
2. Instead of adding callbacks for each writer, there is a single callback who cleans all references to writers where the timeout time has passed (like a timeout based garbage collector). Still, there are the other options: callback for each, set callback time to next timeout