Opened 4 years ago

Closed 4 years ago

#4676 enhancement closed duplicate (duplicate)

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

Reported by: djfroofy Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

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 4 years ago by exarkun

  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #638.

comment:2 Changed 3 years ago by <automation>

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