hi there, folks:
I'd really like to release 0.7.0 but I would like it to be at least a
little bit tested before I do so. Could those of you with CVS trees check
everything out and see if it performs as advertised? Deeper bugs than
that will have to wait for the next release, but I'd at least like to know
if it works for someone other than me.
______ __ __ _____ _ _
| ____ | \_/ |_____] |_____|
|_____| |_____ | | | |
@ t w i s t e d m a t r i x . c o m
On 18 May 2004, the following message was posted to this mailinglist:
Jp Calderone exarkun at divmod.com wrote:
>Daniel Newton wrote:
> I have a simple XML-PRC server similar to the example below:
> from twisted.web import xmlrpc, server
> class Example(xmlrpc.XMLRPC):
> """An example object to be published."""
> def xmlrpc_add(self, a, b):
> """Return sum of arguments."""
> return a + b
> if __name__ == '__main__':
> from twisted.internet import reactor
> r = Example()
> reactor.listenTCP(7080, server.Site(r))
> I want to be able to get the address of the client that calls the
> method can anyone help me with this?
This solution didn't work because 'transport' isn't a property of the
I'm currently in the process of changing from a customized
SimpleXMLRPCServer to a twisted XMLRPC server solution and I need to
insert the client IP into the attributes passed to the called xmlrpc
method. Anyone who knows the answer and is willing to share the info?
Does anyone have some example code for building a reconnecting PB client?
This is what I have now:
from twisted.spread import pb
from twisted.internet import reactor
from twisted.python import util
events = pb.PBClientFactory()
reactor.connectTCP("localhost", 8789, events)
queue = events.getRootObject()
I'm using Twisted 1.3.0 on python2.4 on an Ubuntu-Hoary x86 Linux box.
I'm using twisted and spawnProcess() with a Queue structure to chain
processes that need to be called (specifically, imagemagick commands).
I use the "processEnded" event/method of t.i.p.ProcessProtocol to go
from one task to the next. Twisted shares a python process with a
multi-threaded web-app-kit (Webware) so it has to be run in a thread.
This worked well on other older versions of twisted and older versions
of python; also on linux. I've tracked down the problem to be twisted
itself (or my incorrect use of it) rather than my code. This example
from twisted.internet import reactor
from twisted.internet.protocol import ProcessProtocol
class MyProt( ProcessProtocol ):
def processEnded(self, reason):
print "ended.", reason
executable = '/bin/touch'
args = ( '/tmp/foo.txt', )
args = (executable,) + tuple(args)
reactor.spawnProcess( MyProt(), executable, args )
reactor.callLater( 5, reactor.stop )
As is, this code never runs the "processEnded()" method of MyProt().
If I change the reactor.run() parameter to leave the signal handlers
on, it works.
Note that I need to leave the signal handlers turned off because I
can't run the reactor in the main thread; Webware needs that.
I also know that the subprocess is giving up its file descriptors; I
can see that if I put more print statements into MyProt(). And I know
that the subprocess is working; /tmp/foo.txt is there.
It seems that somehow the reactor is using signals to notice when a
process has ended; this makes a certain ammount of sense intuitively,
though I don't understand the nitty-gritty of processes and signals at
all. And more importantly, this has worked before on other
combinations of twisted/python.
Is this a bug? If so, has it been fixed? If not, what should I do to
detect when a spawned process is finished?
Thanks very much. Twisted rocks.
hi, I want implement such situation:
a client detected a message change, then it notify all the servers that
registed this message arrived. Is observer patter already implemented in
BTW, in Twisted, Is a serverFactory instance one thread? thanks.
I want a line-oriented protocol to listen on an SSL port, and I want
client certificate authentication for this.
How do I specify this:
Am new to twisted and considering to use it instead of
handcoding ssl (have a working example coded in
the demo from
has issues on windows with python 2.4
receive: Hello, world!
receive: What a fine day it is.
connection lost (protocol)
connection lost: Connection to the other side was lost
in a non-clean fashion.
Traceback (most recent call last):
File "q:\socketcomm\echoclient_ssl.py", line 47, in
File "q:\socketcomm\echoclient_ssl.py", line 44, in
line 218, in run
line 226, in mainLoop
--- <exception caught here> ---
line 555, in runUntilCurrent
line 411, in _continueSystemEvent
for callList in sysEvtTriggers,
exceptions.TypeError: unsubscriptable object
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
Version 0.2 of sAsync, "SQLAlchemy Done Asynchronously" has been
released at http://foss.eepatents.com/sAsync. It provides a
Twisted-compatible way to use SQLAlchemy.
There is a fair amount of documentation on the Trac site now, thanks in
large part to users of the package.
sAsync offers asynchronous access to the outstanding SQLAlchemy package
by Michael Bayer. It is built around an 'access broker' object that
provides a priority-queued asynchronous interface to database accesses.
This underlying transaction-queuing structure is much improved in
By wrapping your database-access methods in a @transact decorator, you
can put the underlying method call in a queue with whatever scheduling
priority you designate and immediately obtain a Deferred object that
references the eventual result of the database transaction. The access
broker also includes structure for convenient and integrated table
setup, startup, and shutdown.
The package also provides higher-level SQLAlchemy enhancements
including persistent item storage with deferred read and write results,
and persistent dictionary, array, and graph objects using that storage.
Text indexing and searching, again with deferred 'behind the scenes'
processing, will be included at some point.