alexander-GTMWRiiUHXusTnJN9+BGXg@public.gmane.org
2007-Feb-15 16:15 UTC
Establish Connection on application startup
Hello everyone, I want to integrate status messages over xmpp in my Rails application. My problem is, what I do not want to establish a connection to the jabber server each time a message is sent and disconnect the connection afterwards. So I am looking for a solution to establish the connection on startup and to use this connection in my controllers, when I need it. I am going to use xmpp4r, xmpp4r-simple or jabber4r to communicate with the jabber network. I know, that I have to integrate the initialisation of the connection in the enviroment.rb, but how can I use the connection im my controllers? Should i implementate it through the singelton pattern? I also know, that there are some issues about multiple application instances (because of FastCGI, Mongrel, etc.), but I do not think, that it will be a problem, because there will be no race conditions or something like that. Or would it be a better solution to establish the connection in an application outside of rails and make rails to communicate to ist over distributed ruby. Are there any performance issues with using DRb? With best regards Alexander --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---