2011-06-24

Twisted Python Plugin Example

At EuroPython 2011 there was some very successful and popular training given on Twisted, presented
by Orestis Markou. The room was so packed the first time he gave the training on the Monday of the
conference, he was asked to do it a second time on the Wednesday.

Orestis asked me to put together a few things about best practice for deploying Twisted code. I have deployed many twisted servers so I was more than happy to oblige.

I put on bitbucket my twisted-plugin-example that I quickly composed for an example.

It shows the following:

  • The nice way to write a twisted/plugin/foo.py file.
  • How to use twistd to start your server instead of using a script containing reactor.run()
  • serverFromString + StreamServerEndpointService (i.e. string endpoint descriptions) to specify where to listen.
  • twisted.python.usage.Options
  • How to write a simple custom Service to do any additional setup required.


I think it's an acceptable starting point if someone has a Protocol/Factory and wants to start the transition from "I've experimented with this and it works" to "This is a body of code I would feel okay packaging with distutils and deploying in a VirtualEnv on a hundred servers"

If you have any comments, patches are accepted of course. :)

3 comments:

Samantha Johnson said...

Magnificent to visit your site page again, it has been a long vitality for me. Well this article I have been held tight for such a long time. Shows up you are doing everything in an efficient manner. It is extremely commendable genuinely. genuinely explains everything in detail,the article is inconceivably beguiling and effective.Thank you and perfect conditions for the top level article.

- Samantha Johnson
Contact me @ Write my Essay

sabinasnow said...

I also want to learn new programming skills. But I also study in college, successfully combining it all I get help https://supreme-thesis.com/articles/buy-dissertation-hypothesis/

Australia CDR Report said...

Please click the links that follow below to get CDR report. We are the best choice for the CDR Report Generation.
CDR Report Engineers Australia
CDR Report Writing Services
CDR Career Episode Report Writing
CDR Writing Tips
Australia CDR Sample Free Download