On 10/25/09 6:51 PM, Federico Marani wrote:
I think this is a good idea. PHP is not a language to write daemons
in... and certainly not scalable daemons.

Having a daemon however is not necessary when working with a queue, just
remember to spin off the queue handler that connects to the MQ servers
and downloads the messages before the queue grows too much (or too much
time has passed). You can also use a cronjob to do that, but i'd rather
have a master process to do that in this case.

*nod*

I'm reworking the QueueHandler classes to run the one-offs, which can then be run directly from the single QueueDaemon (simple PHP impl) or spawned out one at a time from a master process.

I can see a problem here with XMPP. With the current setup the
connection needs to be maintained, not true if you convert it to use
XMPP BOSH. In that case you could activate the script each X minutes
(depending on the BOSH timeout you specified), do the queued
elaborations and die. All you need to do is remember sid & rid. However
i do not know how complete is XMPPHP BOSH implementation.

My current plan is to maintain the XMPP connection from the master; we then pass input events off to event handlers, or accept output from queue handlers. This can be done either via stdin/stdout or a pipe, or with one-off connections; still need to finalize some of that.

I read your wiki post and i saw you suggested using a different language
to write this sort of master process. What were your thoughts on this?
I'm experimenting with Scala lately and it's quite impressive... i think
it could be a good candidate, especially if you want to scale up.

Python should be fine for our needs; we basically just need an ActiveMQ connection, an XMPP connection, and a timer for polling-based events.

-- brion
_______________________________________________
StatusNet-dev mailing list
StatusNet-dev@lists.status.net
http://lists.status.net/mailman/listinfo/statusnet-dev

Reply via email to