[REBOL] beta of async:// xml-rpc
From: maarten::vrijheid::net at: 25-Feb-2004 16:22
I integrated async:// from Gabriele with rebXR from Andreas.
rebXR is an XML-RPC implementation, allowing you to invoke remote
functions in REBOL, Java, >NET, Perl ....
See http://earl.strain.at/space/rebXR for more info.
This version, which I hope Andreas will integrate The Right Way in rebXR
as 1.4.0 adds the possibility for an
async client and a standalone server.
Added: xmlrpc-serve 9005 [ function names go here ]
This will start a little HTTP 1.0 daemon on port 9005 that captures any
requests and processes them
e.g. xml-rpc-serve 9090 [ add ]
will expose the add function to XML-RPC clients. Note that the server is
also async:// based.
For the server you need async-protocol.r , libxmlrpc.r and async-xmlrpc.r
Added: async-xmlrpc-exec "host:port/path" [ add 1 2 ]
With no proto at the host (it is converted to async://), and the
callback getting the value of the invocation or an error! value.
If the latter is not handled, there is a silent exit. The callback
*must* be supplied and can be used to initiate an action once a value is
for example updating a GUI, printing, .... Doing I/O in the callback, or
calling a wait might result in trouble (I/O from within I/O handlers is
never a good idea).
Haven't tested that (I suspect writing to a file is OK)
async-xmlrpc-exec "localhost:9090" [add 1 2] :print
forever [wait ]
For the client you need async-protocol.r , libxmlrpc.r and
And change a few do's at the beginning for both client and servers...
Get the beta at: http://www.surfnetters.nl/maarten/xmlrpc.zip
The API may change, depending on what Andreas wants it to look like in
the offical release.