Blog

Book: You Are Not a Gadget: A Manifesto

A generally thoughtful critique of web and open culture. Lanier always has an interesting perspective on things. He’s at his best when articulating his alternative vision, rather than attacking the present, I would say.

Deferreds En Masse

Part 18: Deferreds En Masse

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

Introduction

In the last Part we learned a new way of structuring sequential asynchronous callbacks using a generator. Thus, including deferreds, we now have two techniques for chaining asynchronous operations together.

Sometimes, though, we want to run a group of asynchronous operations in “parallel”. Since Twisted is single-threaded they won’t really run concurrently, but the point is we want to use asynchronous I/O to work on a group of tasks as fast as possible. Our poetry clients, for example, download poems from multiple servers at the same time, rather than one server after another. That was the whole point of using Twisted for getting poetry, after all.

Just Another Way to Spell "Callback"

Part 17: Just Another Way to Spell “Callback”

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

Introduction

In this Part we’re going to return to the subject of callbacks. We’ll introduce another technique for writing callbacks in Twisted that uses generators. We’ll show how the technique works and contrast it with using “pure” Deferreds. Finally we’ll rewrite one of our poetry clients using this technique. But first let’s review how generators work so we can see why they are a candidate for creating callbacks.

Book: Blood of the Liberals

Packer reviews the last century or so of liberalism through the biographies of his father and grandfather.

Site reorganization

Today I made my blog my main website, since the old one was getting kind of crufty. I moved the stuff I wanted to keep into Wordpress, including my collection of links to programmer’s editors. The old /blog URLs will continue to work.

Book: The Autumn of the Middle Ages

This book is my favorite sort of history: an exploration of the minds and viewpoints of the people who lived it. The medieval world-view is so alien to us, and Huizinga lets us glimpse it.

3-D Shmee-D

I watched a 1-D film yesterday. Good acting, but I thought the plot was too linear.

Book: Mohammed and Charlemagne

Pirenne’s posthumous work where he advances the thesis that Medieval Europe was made possible by the rise of Islam, which severed many of the East-West ties that kept the West under the influence of Byzantium.

Twisted Daemonologie

Part 16: Twisted Daemonologie

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

Introduction

The servers we have written so far have just run in a terminal window, with output going to the screen via print statements. This works alright for development, but it’s hardly a way to deploy services in production. A well-behaved production server ought to:

  1. Run as a daemon process, unconnected with any terminal or user session. You don’t want a service to shut down just because the administrator logs out.
  2. Send debugging and error output to a set of rotated log files, or to the syslog service.
  3. Drop excessive privileges, e.g., switching to a lower-privileged user before running.
  4. Record its pid in a file so that the administrator can easily send signals to the daemon.

We can get all of those features using the twistd script provided by Twisted. But first we’ll have to change our code a bit.

Book: Flow: The Psychology of Optimal Experience

A rather extraordinary book about happiness and its sources. And by extraordinary I mean it makes you see the world in a different way, always a good trait for a book.