[Twisted-Python] Simple Epoll Reactor question

Andrew Francis andrewfr_ice at yahoo.com
Sun Jul 19 12:08:12 EDT 2009

Hello Glyph et al:

Message: 6
Date: Sat, 18 Jul 2009 16:11:42 -0400
From: Glyph Lefkowitz <glyph at twistedmatrix.com>
Subject: Re: [Twisted-Python] Simple Epoll Reactor question
To: Twisted general discussion <twisted-python at twistedmatrix.com>
    <d9047f780907181311r29018280n3d4fdd578d60a270 at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Sat, Jul 18, 2009 at 2:41 PM, Andrew Francis<andrewfr_ice at yahoo.com> wrote:

> What am I doing wrong? Thanks in advance.

The first google hit for "epollreactor api" is:

And I read that page.

>The two lines of code there are the *only* things your program should
>do in order to use the epoll reactor.  (Actually, you should just use
>the '-r' option to 'twistd', but I digress.)  After those lines are
>run, your program should 'from twisted.internet import reactor' as

Okay I restructured the code as

from twisted.internet import epollreactor
from twisted.internet import reactor

and this works. Thanks. Before I was getting "reactor already installed" errors when I used epollreactor.install() (this is to answer Cary Hull's question about commenting out that line).

Adding 'from twisted.internet import reactor' wasn't obvious to me. Perhaps this should also be mentioned on the "Choosing a Reactor" page for completeness?



More information about the Twisted-Python mailing list