[Twisted-Python] Plugin Example - review appreciated

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Wed Jun 22 05:03:47 MDT 2011


On 07:32 am, stephen at thorne.id.au wrote:
>On Tue, Jun 21, 2011 at 23:32,  <exarkun at twistedmatrix.com> wrote:
>>Don't define Options or makeService in the dropin file.
>>
>>Use twisted.application.service.ServiceMaker instead of implementing
>>your own.
>
>Oh that's nice. I'll rewrite to use that now. What's the first
>argument to ServiceMaker, 'name' for? it's not documented.
>>It's not "strports" anymore.  It's "string endpoint descriptions" or
>>just "endpoints".  You are using the right API but you named all the
>>options and variables wrong.
>>
>>Unit tests.
>>
>>Don't use the global reactor in SetupService.
>
>okay, I've changed this to do 'from twisted.internet import reactor'
>at the top of the two methods that access the reactor.

That's still the global reactor.  "from twisted.internet import reactor" 
is always the global reactor.  Instead, you should make the reactor a 
parameter.

Jean-Paul




More information about the Twisted-Python mailing list