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()
On Sat, 28 Apr 2007 23:37:57 -0600, Jonathan Lange <jml(a)wolfwood.twistedmatrix.com> wrote:
>Date: Sat Apr 28 23:37:56 2007
>New Revision: 20094
>Add a spewing decorator which stores all of the function and method calls
>within a function in a structured data object.
What ticket is this associated with?
Also, there is already an improved spew function in Epsilon which does nice
things like track call depth and exception propagation and call arguments.
I'm looking for a way to combine serial input with UDP (and possibly
Currently I have a very simple quick-and-dirty script using pyserial and
the socket module without Twisted that reads line-based data from a
serial port and sends it out using UDP. It works very well, but
functional and reliability requirements are growing and I'm looking for
a better design. New functionality that we'll need is connection to a
database, two-way network communication to control the program while
it's running, and perhaps the ability to use encrypted connections for
the output data.
Twisted seems nice, but apart from a few simple hello-world-style test I
don't have any experience with it. It doesn't seem too difficult though,
except for one thing: I can't find any concrete information on how to
combine serial communication and network communication. What reactor do
I need? How do I initialize it? How can I make it listen to both a
serial port and one or more UDP and/or TCP ports? I need to do this on
Linux, but it would be nice to have it working on Windows too.
If I have been able to see further, it was only because I stood
on the shoulders of giants. -- Isaac Newton
I have programmed very traditional systems passed on fork and pthreads
and have used state machine systems. Last year I started working with
Twisted Matrix. Each has their appropriate application.
I started thinking about how to implement the following in Twisted, and
realized I don't know if it is possible. I thought I would ask the list
to find out if someone can come up with an answer.
Suppose I have a sequence of instructions, some of which can take a long
time. For example in a non-Twisted Matrix system I would do:
....do some computation....
proxy = xmlrpc.Proxy("http://....")
... take the results of the CallRemote and use them...
In this example I assume CallRemote() only returns a result when it has
In the Twisted Matrix system I would do something like:
...do some computation....
proxy = twisted.web.xmlrpc.Proxy("http://...")
defer = proxy.CallRemote(...)
And I would define fcs_StoreErr() and fcs_storeDone(). In
fcs_storeDone() I would take the results from the CallRemote() and
My question is easy (the answer might be hard):
Can I emulate the non-Twisted example in the Twisted Matrix
system. In other words can I create something like CallRemote() which
returns only there is a result to process and get away from having to
explicitly use a defer?
Is there a readme file or an example how to setup server and client
and add jobs to it. If someone can share a simple example, it would
be great. I think this is a good tool. I am a newb. Example would
be great so the masses can hop on.
I was able to run the "semi-functional Twisted XML-RPC Server"
example, available on http://foss.eepatents.com/sAsync/wiki/Examples
However, I have the error message below on the server side when
changing the database from sqlite to postgres.
Any info would be greatly appreciated.
.py -noy server.py
2007/04/27 16:41 Paris, Madrid [-] Log opened.
2007/04/27 16:41 Paris, Madrid [-] twistd 2.1.0
(C:\Python24\python.exe 2.4.4) starting up
2007/04/27 16:41 Paris, Madrid [-] reactor class:
2007/04/27 16:41 Paris, Madrid [-] Loading server.py...
2007/04/27 16:41 Paris, Madrid [-] Loaded.
2007/04/27 16:41 Paris, Madrid [-] twisted.web.server.Site starting on 8080
2007/04/27 16:41 Paris, Madrid [-] Starting factory
<twisted.web.server.Site instance at 0x011A7C38>
2007/04/27 16:41 Paris, Madrid [-] Traceback (most recent call last):
Failure: psycopg2.ProgrammingError: no results to fetch
2007/04/27 16:41 Paris, Madrid [-] 127.0.0.1 - - [27/Apr/2007:14:41:52
+0000] "POST /RPC2 HTTP/1.0" 200 263 "-" "Twisted/XMLRPClib"
2007/04/27 17:00 Paris, Madrid [-] Received SIGINT, shutting down.
2007/04/27 17:00 Paris, Madrid [-] (Port 8080 Closed)
2007/04/27 17:00 Paris, Madrid [-] Stopping factory
<twisted.web.server.Site instance at 0x011A7C38>
2007/04/27 17:00 Paris, Madrid [-] Main loop terminated.
2007/04/27 17:00 Paris, Madrid [-] Server Shut Down.
-----BEGIN PGP SIGNED MESSAGE-----
I am attempting to write a simple load test for my soap web services.
I am running the application under twistd and using trial for unit
tests. I understand that for a real load test, I would use a tool
like ab or http_load in a more scientific environment but I want to
get a quick feel for how well a twisted application stands up against
low levels of load on my dev box and I feel that there is merit in
setting a baseline level of performance in a unit test.
I am running into problems with the following:
url = 'http://localhost:8080/'
self.proxy = Proxy(self.url)
"""Assert that multiple APCs succeed"""
deferred = defer.Deferred()
for i in range(100):
d = self.testAPCTimeout()
deferred = self.proxy.callRemote('processApc', 0,
def APCTimeout(self, result):
requestIdForApc, requestDataForApc, errorFlag, result = result
For a start, I get a lot of 'reactor left in unclean state' warnings.
This number of twisted.internet.tcp.Client instances that this
reports on is never usually all of them:
twisted.trial.util.DirtyReactorError: THIS WILL BECOME AN ERROR SOON!
reactor left in unclean state, the following Selectables were left
over: <<class 'twisted.internet.tcp.Client'> to ('localhost', 8080)
at 1782390> <<class 'twisted.internet.tcp.Client'> to ('localhost',
8080) at 1782150> ...
In addition I get pending time calls still pending:
twisted.trial.util.PendingTimedCallsError: pendingTimedCalls still
pending (consider setting twisted.internet.base.DelayedCall.debug =
True): <DelayedCall 24636392 [24.8269200325s] called=0 cancelled=0
Does any twisted genius have any idea what I am doing wrong?
m a t t h e w g l u b b
Z Group PLC
Tel: +44 (0) 8700 111 173
Fax: +44 (0) 8707 051 393
Txt: +44 (0) 7800 140 877
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. The opinions expressed in this mail are those of the author
and do not necessarily represent the views of the company. If you have
received this email in error please notify <service(a)zgroupplc.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
-----END PGP SIGNATURE-----