Quantcast
Channel: Terry Jones » Search Results » deferred
Browsing latest articles
Browse All 18 View Live

A Python metaclass for Twisted allowing __init__ to return a Deferred

OK, I admit, this is geeky. But we’ve all run into the situation in which you’re using Python and Twisted, and you’re writing a new class and you want to call something from the __init method that...

View Article


A kinder and more consistent defer.inlineCallbacks

Here’s a suggestion for making Twisted‘s inlineCallbacks function decorator more consistent and less confusing. Let’s suppose you’re writing something like this:     @inlineCallbacks     def func():...

View Article


A mixin class allowing Python __init__ methods to work with Twisted deferreds

I posted to the Python Twisted list back in Nov 2008 with subject: A Python metaclass for Twisted allowing __init__ to return a Deferred Briefly, I was trying to find a nice way to allow the __init__...

View Article

Image may be NSFW.
Clik here to view.

Facebook release Tornado and it’s not based on Twisted?

Image: Jay Smith To their great credit, Facebook have just open-sourced more of their core software. This time it’s Tornado, an asynchronous web server written in Python. Surely that can only mean one...

View Article

Fault-tolerant Python Twisted classes for getting all Twitter friends or...

It’s been forever since I blogged here. I just wrote a little Python to grab all of a user’s friends or followers (or just their user ids). It uses Twisted, of course. There were two main reasons for...

View Article


Twisted code for retrying function calls

These days I often find myself writing code to talk to services that are periodically briefly unavailable. An error of some kind occurs and the correct (and documented) action to take is just to retry...

View Article

Asynchronous data structures with Twisted Deferreds

Earlier this week I gave a talk titled Deferred Gratification (slides) at EuroPython in Birmingham. The title was supposed to hint at how much I love Twisted‘s Deferred class, and that it took me some...

View Article

Twisted’s Deferred class chainDeferred method is too simplistic?

I think it’s worth spending some time thinking about whether chainDeferred in twisted.internet.defer.Deferred is too simplistic. I’ve thought for a while that it could be more helpful in preventing...

View Article


Graceful shutdown of a Twisted service with outstanding deferreds

I’ve been spending a bit of time thinking again about queues and services. I wrote a Twisted class in 2009 to maintain a resizable dispatch queue (code in Launchpad, description on the Twisted mailing...

View Article


How to asynchronously exchange a dictionary using Twisted deferreds

Here’s a fun class that I can’t think of a good use for :-) But I like its simplicity and it’s another illustration of what I like to call asynchronous data structures. Suppose you have a producer...

View Article

A resizable dispatch queue for Twisted

In December 2009 I posted to the Twisted mailing list about what I called a Resizable Dispatch Queue. I’ve just spent some time making a new version that’s much improved. You can pick up the new...

View Article

txdpce: a Twisted class for deferred parallel command execution

I just uploaded a simple Twisted Python class, txdpce, to Launchpad. It’s designed for situations where you have multiple ways of obtaining a function result and you want to try them all in parallel...

View Article

Simpler Twisted deferred code via decorated callbacks

This morning I was thinking about Twisted deferreds and how people find them difficult to grasp, but how they’re conceptually simple once you get it. I guess most of us tell people a deferred is...

View Article


Yet another cancelable Twisted deferred class

I’m posting this (completely untested!) to illustrate how one could write a class to provide a Twisted deferred-like class, identical to the twisted.internet.defer.Deferred class, but which lets you...

View Article

jQuery-when2 – a more flexible way to work with jQuery deferreds

I’ve often been frustrated by the limited functionality of jQuery.when. You give it some deferred objects and it fires when all the deferreds are finished. The trouble is, if any of the deferreds is...

View Article


Image may be NSFW.
Clik here to view.

Promises are first-class objects for function calls

Have you ever programmed in a language without functions as first-class objects? You can’t return a function from a function, can’t pass a function as an argument, and you certainly can’t make...

View Article

txdlo – a Twisted deferred list observer

Last night I wrote txdlo, a Python package that provides a class called DeferredListObserver. As you might guess, it lets you observe callback and errback events from a list of Twisted deferreds. You...

View Article


Image may be NSFW.
Clik here to view.

Learning jQuery Deferreds published

Nicholas Tollervey and I have written a book, Learning jQuery Deferreds, published by O’Reilly. If you’ve been a reader of this blog over the years, you may have noticed that I’m very fond of deferreds...

View Article
Browsing latest articles
Browse All 18 View Live


Latest Images