My question is similar in spirit to Creating Socket Connections that are persistent across multiple page loads in a single web session
. I need to keep certain objects alive and well between requests to a mod_perl program. As unlinker
mentioned in his last comment on that thread, I also need to keep the pool of persistent objects global (one pool total, not one pool per apache process or apache thread). In my case it will be ssh connection objects. Is there a way to keep a global cache?
My understanding of POE and the like is that it can run as a separate process on the web server and my mod_perl code can possible talk to it. However, it seems like I won't be able to actually pass active Net::SSH objects or similar back and forth between separate programs. I could potentially have all interaction with the Net::SSH objects happen on the POE side but I would appreciate suggestions on how to structure this so that my mod_perl program can talk to the POE program to get the correct POE child/thread/process and then talk to that directly.
Essentially, I will have a number of users connecting to apache which will be running mod_perl. These users would be indirectly interacting with remote SSH connections that need to be pooled on the server side and must be persistent so the users' current ssh sessions don't get disconnected/lost/overwritten between requests.