[PEAK] need hints on PEAK twisted support

Ulrich Eck ueck at net-labs.de
Thu Apr 8 07:38:46 EDT 2004


Hi Stephen,

> So now for my newbie questions:
> (1)  The bulletins executable doesn't work for me.  Is there another
> way to run it?  (I tried 'peak runIni bulletins' but got a
> traceback ending in "ImportError: No module named bulletins")

have you set the PYTHONPATH to ./src ?
cd examples/bulletins
export PYTHONPATH=./src:$PYTHONPATH
peak runIni bulletins createdb

> (2)  In general, would twistd be used in a PEAK context at all, or
> just reactor.run()?

in PEAK you use the EventDriven Component as App-Component (or
subclasses of it) instead of Twistd. peak.event.Tasks are then
scheduled in the TwistedReactor that can use async io/deferreds

> (3)  I assume that when PEAK and Twisted are used together,
> peak will play honcho and will initialize twistd or the
> reactor, etc., so it would probably make sense to use PEAK's
> configuration apparatus instead of Twisted's, yes?

right .. ini- and ZConfigFiles are the way to go.


i'm working on an peak.web example that uses twisted.http-server

http://peakplace.tigris.org/source/browse/peakplace/src/sandbox/ueck/xslweb

the files at:
src/webtools/webtools.ini
src/webtools/twistedweb.py

might be of interest. it shows how to use the twisted.http-Server 
with the web-features of peak. the other modules try to fill
gaps that exist now with some q&d solutions.

its work in progress, so don't expect anything polished.

hope this helps a bit further

cheers
Ulrich





More information about the PEAK mailing list