Blog

A Second Interlude, Deferred

Part 9: A Second Interlude, Deferred

This continues the introduction started in the first part. You can find an index to the entire series.

More Consequence of Callbacks

We’re going to pause for a moment to think about callbacks again. Although we now know enough about deferreds to write simple asynchronous programs in the Twisted style, the Deferred class provides more features that only come into play in more complex settings. So we’re going to think up some more complex settings and see what sort of challenges they pose when programming with callbacks. Then we’ll investigate how deferreds address those challenges.

Book: Economics: A Very Short Introduction

There’s a whole series of Very Short Introductions. So far, so good, I think I’ll check out more of them.

Book: Carpe Jugulum

The witches of Lancre versus vampires. Pratchett seems to be the ideal author to read while getting a tattoo. So now I only read Pratchett when getting work done. Here’s me getting some work at the Convention of the Tattoo Arts. The artist is Suzanne Shifflett. She is very good.

Book: Sway: The Irresistible Pull of Irrational Behavior

A quick, fascinating tour through our subconscious mind and its influence over our behavior. We seldom seem to be in as much control of ourselves as we think.

Deferred Poetry

Part 8: Deferred Poetry

This continues the introduction started in the first part. You can find an index to the entire series.

Client 4.0

Now that we have know something about deferreds, we can rewrite our Twisted poetry client to use them. You can find client 4.0 in twisted-client-4/get-poetry.py.

Our get_poetry function no longer needs callback or errback arguments. Instead, it returns a new deferred to which the user may attach callbacks and errbacks as needed.

Book: Human: The Science Behind What Makes Us Unique

Focusing on what makes human beings unique, Gazzaniga reviews the latest research across many scientific disciplines. It’s all good, and written in an enjoyably informal style, but he’s at his best in the later chapters when discussing his own specialty, the human brain and mind. Will have to read some more of his stuff.

An Interlude,  Deferred

Part 7: An Interlude,  Deferred

This continues the introduction started in the first part. You can find an index to the entire series.

Callbacks and Their Consequences

In Part 6 we came face-to-face with this fact: callbacks are a fundamental aspect of asynchronous programming with Twisted. Rather than just a way of interfacing with the reactor, callbacks will be woven into the structure of any Twisted program we write. So using Twisted, or any reactor-based asynchronous system, means organizing our code in a particular way, as a series of “callback chains” invoked by a reactor loop.

And Then We Took It Higher

Part 6: And Then We Took It Higher

This continues the introduction started in the first part. You can find an index to the entire series.

Poetry for Everyone

We’ve made a lot of progress with our poetry client. Our last version (2.0) is using Transports, Protocols, and Protocol Factories, the workhorses of Twisted networking. But there are more improvements to make. Client 2.0 (and also 2.1) can only be used for downloading poetry at the command line. This is because the PoetryClientFactory is not only in charge of getting poetry, but also in charge of shutting down the program when it’s finished. That’s an odd job for something called “PoetryClientFactory”, it really ought to do nothing beyond making PoetryProtocols and collecting finished poems.

Book: The Beak of the Finch: A Story of Evolution in Our Time

A fantastic book about the observations of evolution in modern-day animals, centered around the study of Darwin’s finches on Galapagos by Rosemary and Peter grant.

More Pictures

Thanks to ScanCafe, more pictures of Beth’s London days, and a few different trips abroad.