Taming Twisted with Generator Trampolines: An Introduction to Monocle

The usual style of client/server programming using Twisted involves writing many callbacks and error-handlers.
Sequences of events get lost in a sea of unconnected methods. The Monocle module provides a straight-forward way of consolidating event sequences and their error handlers into a single generator.
The resulting code is clean, easy-to-write, and easy-to-read.

This talk walks through examples of how to write client/server logic using Monocle and then it explores how Monocle works, starting with a trampoline model using simple generators, improving the model with generators that can return values, and showing how exceptions can be cleanly wrapped into the model.

Walk away with a clear understanding of how to use Monocle and how it works.

pycon4 - Sat 08 may / 14:30 in the track Scoprire Python.


Language
EN
Duration
45 minutes
Simultaneous translation
available