Opened 7 years ago

Closed 7 years ago

#4676 enhancement closed duplicate (duplicate)

There's no api for setting components in a twistd plugin

Reported by: Drew Smathers Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

Currently there's no api for setting the components in a twistd plugin. In .tac files, this is trivial:

application.setComponent(ILogObserver, PythonLoggingObserver().emit)

The only way I know how to do this is inheriting from MultiService:

class PythonLoggingMultiService(service.MultiService):

    def setServiceParent(self, parent):
        super(PythonLoggingMultiService, self).setServiceParent(parent)
        parent.setComponent(ILogObserver, PythonLoggingObserver().emit) 

twistd plugins: http://twistedmatrix.com/documents/current/core/howto/tap.html

Change History (2)

comment:1 Changed 7 years ago by Jean-Paul Calderone

Resolution: duplicate
Status: newclosed

This is a duplicate of #638.

comment:2 Changed 7 years ago by <automation>

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.