[Twisted-Python] twistd caching method calls?

Jim Rainville jim at rainville.net
Sun Jun 15 09:23:26 MDT 2014


Hi - 

I have a very simple twisted service that reads a temperature sensor. A client can ask for the current temperature via JSON and as a result the service will read the temperature sensor and respond with the current temp. This works great if I run it as a python module from the command line but if I run it as a service with twistd it seems to read the temp on startup then the temp seems to be cached as it never changes. I have print calls in the getTemp method right before it calls into the hardware library, they are getting called in both cases - but the return from the call never changes in the twistd case. Any ideas?

Also, I have another service (not twisted) that runs in the background that periodically reads the temp and responds to temperature changes. This is working fine so I’m pretty sure the problem is isolated to twistd.

Thanks. 
Jim




More information about the Twisted-Python mailing list