more stomp.rb changes, need feedback on handling reliable disconnect
So I ended up working a good bit today on refactoring ActiveMessaging, and I found another case I missed of making @reliable=true work for stomp.rb, I'll send an attached new version to this list once I am sure I don't have any more changes from my testing.
One problem I am seeing I don't have a good answer to is when you call Connection.disconnect, but activemq is down.
The socket method keeps trying to reconnect in order to send the disconnect message - seems a bit odd that it would fail to complete. To get around this I have been setting reliable=false when I am trying to shut down my program that uses a stomp Connection, so even if it errors out, it completes. I could have the disconnect method do this automatically, which would perhaps be better (is there ever a case you should retry connecting in order to send a disconnect?)
Another way to handle this might be to have some additional parameters, like max num of retries, or wrapping in some timeout period so if it can't disconnect w/i 10 secs, it quits trying.
Anyway, I'd like to include some fix for this as well, but wanted a little feedback about how others thought about it.
Suggestions?
-Andrew