On Wed, Dec 9, 2009 at 6:57 AM, Larry Garfield <[email protected]> wrote: > It's true that resources like DB connections or file handles don't survive > serialization. That's why PHP offers the __sleep() and __wakeup() magic > methods that you can use to control what gets serialized or deserialized if > necessary. You can find more on them on http://www.php.net/
Correct. But the main thing an XMPP class does is maintaining a connection (which is a resource) to the XMPP server. And If I understood the thread starter correctly, the idea is to avoid the connection initialization. I'm doing something similiar right now and in my case, initalizing the connection to the server takes ~40% of the whole request time. If I have to do that in every __wakeup() call, I don't gain anything.
