---------- Mensaje reenviado ----------
Subject: Re: [xmlblaster] Newbie question: xlmblaster and php: how to get
updates?
Date: Miércoles, 6 de Septiembre de 2006 20:41
From: Marcel Ruff <mr at marcelruff.info>
To: xmlblaster at server.xmlblaster.org
Eduard Martinez wrote:
> Hello
>
> I'm trying to implement an application which sends messages asynchrolously
> between a java application an several php clients. I took a look to the
> php
> demo, but I can't figure how to suscribe on a topic and specify
> something to
> get updates when there is a new message of the topic, like the java
> client.
> Is it possible? How can I do it?
>
> Cheers,
>
> Edu
Salute Edu,
i don't think that Cyrilles XmlRpc demo supports callbacks.
So you need to make your own implementation,
here are three approaches you could try:
1. Extend Cyrilles XmlRpc example with a XmlRpc-callback server,
there are many such implementations, see
http://www.xmlrpc.com/directory/1568/implementations
2. Access our xmlBlaster C library from PHP.
Like this you have tunneled callbacks, high performance, zlib compression
See
http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.c.socket.html
and see how our C# example is doing this:
http://www.xmlblaster.org/xmlBlaster/doc/requirements/client.csharp.html
3. You can use Cyrilles XmlRpc PHP code and use blocking get() calls
(with timeouts):
You would subscribe with PHP but the clients callback queue has set
dispatcherActive=false
so the messages are collected on server side. Now you can use
synchronous get()
calls which block until messages are available
(see
xmlBlaster/src/java/org/xmlBlaster/client/XmlBlasterAccess.java:receive()
as a
code sample to use for PHP).
This approach is very simple but you need to use a dedicated thread in
PHP for the blocking get() call
(see also
http://www.xmlblaster.org/xmlBlaster/doc/requirements/engine.qos.queryspec.Qu
eueQuery.html)
regards
Marcel
-------------------------------------------------------