[rabbitmq-discuss] Improving our documentation

jiri at krutil.com jiri at krutil.com
Tue Nov 23 11:57:22 GMT 2010


> We could register a shutdown hook to perform clean up on exit, but that
> feels like overkill for such a simple example. I can't think of another way
> to guarantee that cleanup happens. Even without the infinite loop a user
> can still Ctrl-C.

In view of what David wrote about the operating system closing the  
connection when the client process dies, I guess there is no point  
addressing the case when user kills the process.

I personally would consider giving the user a possibility to ask the  
program to shut down by listening for the messages on a separate  
thread and using the main thread to wait for user input. But that  
would probably make the example harder to understand.

> I'm very tentatively toying with the idea of working up a patch for the
> client itself that will register a shutdown hook and maintain a set of weak
> refs to connections for clean up on termination. What do you think about
> this?

I don't think that's necessary and I would not expect that from a  
client library. The programmer using the client library should have  
control over the resources and is responsible for proper cleanup.


More information about the rabbitmq-discuss mailing list