Oops, somehow this missed going to the list...

---------- Forwarded message ----------
From: Derrell Lipman <[EMAIL PROTECTED]>
Date: Thu, May 1, 2008 at 10:17 AM
Subject: Re: [qooxdoo-devel] No Python backend support?
To: [EMAIL PROTECTED]


On Thu, May 1, 2008 at 9:56 AM, <[EMAIL PROTECTED]> wrote:


> >I believe someone has also written a python backend, but I haven't seen
> it.
>
> That's what I am looking for.  I am really proficient in Python and that's
> my preferred way to go.


Ok.  If you can't find an already-written Python backend and you're
proficient in Python, you should be able to write a backend yourself quite
quickly.  Read the SERVER_WRITER_GUIDE, and then use whichever of the
existing backends you find easiest to read (probably PHP) for comparison as
you're writing your backend.  It's not a very difficult task, and at least
one backend, the perl one, has been written entirely in the way I'm
suggesting: from the docs.

>Backends are easy to write, with documentation in the backend directory if
> you pull from SVN, in a file called SERVER_WRITER_GUIDE.  These backends
> provide the core functionality that you allow you to write simple remote
> procedure call processors.  JSON messages are passed back and forth between
> the client and server.  The qooxdoo class qx.io.remote.Rpc provides the
> methods your client-side application would use to issue requests to the
> server, and the backend responds.
>
> Does anybody has a simple example to show how this is done?


You can look at the  RPC tests in
qooxdoo/frontend/application/demobrowser/source/html/test/RPC_*.html.
RPC_1.html issues an echo request to the server and is probably the simplest
example.  RPC_4.html is the one you'll want to run against your server, as
it tests that all of the primitive types are properly handled.

>ps. Avoid the temptation to issue synchronous requests from your client to
> the server.  They block not only your application (including any animated
> gif files you have displayed) but also anything running in other tabs!
>
> This flew right over my head.  What's a non-"synchronous requests"?  So,
> the client code has to dispatch a request to the server and just sit there
> and poll all incoming messages and see if it's for me?  Likewise, the server
> simply respond to requests and dispatch result to the other side?  So you
> have to tag on a cookie of some kind to each message that goes back and
> forth?


That's all handled for you.  If you issue only a single request at a time,
you needn't worry about receiving multiple responses.  OTOH, if you want to
be able to issue a number of concurrent requests and later receive back the
responses, each response is identified as to which request is corresponds
to.   RPC_6.html demonstrates this feature.  You'll see, though, even in the
simple RPC_1.html, how to make a simple async request.

>
> With Pyro, the server starts up and sit there.  The client code sets up
> some server searching code and once that's done, you simply call the
> function as if you were running them locally.  But then it would mean that
> these are "synchronous requests" then.


Synchronous vs asynchronous is really referring to whether the low-level
browser-provided service (e.g. XmlHttpRequest) is told to operate
synchronously or not.  Your application can actually do other stuff while
awaiting the response or not, even if you specify async.  I don't know if
Pyro uses synchronous requests internally.  Take a look at the tests and at
the documentation for qx.io.remote.Rpc for more details.

Cheers,

Derrell




-- 
"There is nothing more difficult to plan, more doubtful of success, nor more
dangerous to manage than the creation of a new system. For the initiator has
the enmity of all who would profit by the preservation of the old system and
merely lukewarm defenders in those who would gain by the new one."
--Machiavelli, 1513
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to