from twisted.internet import app
class FooService(app.ApplicationService):
def startService(self):
# do startup stuff
def stopService(self):
# do shutdown stuff
def foobrizate(self):
# business logic!
application = app.Application('foobnator')
svc = FooService('foo', application)
application.getServiceNamed('foo') is svc # True