[development] Add data to Drupal session
Paolo Mainardi
paolomainardi at gmail.com
Wed Dec 9 13:20:04 UTC 2009
A nice article on PHP Daemon implementation:
http://www.bbgamedev.net/index.php/writing-a-daemon-in-php/
On Wed, Dec 9, 2009 at 11:37 AM, Paolo Mainardi <paolomainardi at gmail.com>wrote:
>
>
> On Wed, Dec 9, 2009 at 9:35 AM, Sascha Grossenbacher <saschagros at gmail.com
> > wrote:
>
>> On Wed, Dec 9, 2009 at 6:57 AM, Larry Garfield <larry at garfieldtech.com>
>> 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.
>>
>
> I think that best solution in this case, is to have a background process in
> charge of managing XMPP related jobs, avoiding to create for each request a
> new XMPP environment.
>
> Ex:
> Request ---> Drupal <--socket--> XMPP Server (background process)
>
>
>
>
>
> --
> Paolo Mainardi
>
> CTO Twinbit
> Blog: http://www.paolomainardi.com
>
> -- Please consider the environment before printing this email --
>
--
Paolo Mainardi
CTO Twinbit
Blog: http://www.paolomainardi.com
-- Please consider the environment before printing this email --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20091209/de8eb24a/attachment.html
More information about the development
mailing list