<div dir="ltr">Hi,<div><br></div><div>Did you consider adding a configuration variable that turns this feature on and off and can be used to set up environments differently for dev/test/prod?</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">---<br><div>Vsevolod Dyomkin<br></div><div><div>+38-096-111-41-56</div><div>skype, twitter: vseloved</div></div></div></div></div>
<br><div class="gmail_quote">On Sat, Jul 4, 2015 at 4:30 AM, Elias MÃ¥rtenson <span dir="ltr"><<a href="mailto:lokedhs@gmail.com" target="_blank">lokedhs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The following question was raised during my development of an <a href="https://github.com/lokedhs/cl-rabbit-async" target="_blank">asynchronous library</a> I'm currently building for RabbitMQ.<div><br></div><div>In summary, the library allows you to create an object of type <font face="monospace, monospace">ASYNCH-CONNECTION</font>, from which instances of <font face="monospace, monospace">ASYNC-CHANNEL</font> can be retrieved. A connection holds a reference to all channels that it uses, and each channel holds a reference to its connection. The connection object has a pointer to a native CFFI object that for the underlying connection (my library is built on the RabbitMQ C API).</div><div><br></div><div>My question is: Should I use trivial-garbage to create a GC hook for the connection object so that if the user of the library forgets to close the connection, it will get closed eventually once it's GC'ed?</div><div><br></div><div>I can see arguments for both behaviours:</div><div><ul><li>It's a bad idea, since losing the reference to the connection object means that the program is broken, and silently cleaning up the underlying connection might hide the fact there is a bug (if the GC doesn't run often enough I might have hundreds or even thousands of lingering connections)</li><li>On the other hand, it might be a good idea since Lisp developers often use the REPL to experiment, so it's easy to accidentally lose a reference to an object during testing. Thus, using the GC hook will improve the stability of one's development environment.</li></ul><div>To me, there is no strictly correct answer to the question, which is why I'm asking for suggestions from you guys.</div></div><div><br></div><div>Regards,</div><div>Elias (loke on #lisp)</div></div>
</blockquote></div><br></div>