3-5 July 2006
CERN, Geneva
Europe/Zurich timezone

Integrating Twisted With Existing Applications

3 Jul 2006, 09:35
40-S2-A01 (CERN, Geneva)


CERN, Geneva

Python Language and Libraries Python Language and Libraries


Mr Moshe Zadka (B-hive Networks)


Twisted is an event-based framework, with many high-level constructs for handling networking, threads and more. Unfortunately, existing applications are often written so as to own a whole thread of execution. This talk will survey various techniques, using an arranged hypothetical case study, for integrating Twisted with already-existing applications.


Techniques such as using generators and defgen, using Twisted's thread support and
how to rewrite existing code for an event based network will be explained, all
arranged around a hypothetical protocol for saving and restoring key/value pairs.
Non-event-based code will be shown, and incrementally modified to integrate with
Twisted's native facilities. The technique of breaking up synchronous code along
waiting points, using deferreds and explicit state management, will be covered, as
well as using defgen to make this easier, and using Twisted's built-in thread pool
management when needing to integrate with inherently-blocking code.

Primary author

Mr Moshe Zadka (B-hive Networks)

Presentation Materials