[Twisted-Python] Getting a list of services and/or plugins are currently running

Johann Borck johann.borck at densedata.com
Mon Oct 18 16:28:46 EDT 2010


On 10/18/2010 09:10 PM, Elizabeth Liao wrote:
> [...]
> What would like to do is to somehow identify what twisted 
> services/plugins are running because different things happen depending 
> on what plugin is currently in use.  We are running on Linux wanted to 
> see if there was an easy way of doing that using the twisted 
> libraries.  I suppose one solution is to get a list of processes 
> running and parse that but I would rather not do that.
>
Hi Elizabeth,
I don't think (and meanwhile know, because Glyph already answered) 
there's a ready-made solution for your requirements (inside twisted, at 
least), but it should be relatively straightforward to implement one 
using twisted. If I understand you correctly, you need an interface to 
query which plugins/services (aka t.a.s.Services) in which twisted 
processes are in which state on a given machine, or even all machines 
involved in your setup. Since you can have several machines running 
several twisted processes, where each process can have several plugins 
installed each in different states, and each plugin can offer several 
Services, which also can be in different states, (and even install/run 
other plugins and services ) twisted itself per default obviously cannot 
provide an interface to query all this information, if only because a 
given process just knows about itself.

If I wanted to implement this, I'd start with a central service, that 
offers an interface for (twisted) apps/clients/servers to register 
themselves on startup. All "participating" plugins and services would of 
course have to know about that service, but depending on your 
requirements it might suffice to use a common subclass of  
twisted.application.service.Service, that takes care of performing the 
necessary steps to inform your central state-monitoring service about 
their existence and state.

Johann


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20101018/8efcd1d7/attachment-0001.htm 


More information about the Twisted-Python mailing list