class documentation

class twisted.application.service.Service: (source)

Known subclasses: twisted.application.internet._VolatileDataService, twisted.application.internet.ClientService, twisted.application.internet.CooperatorService, twisted.application.internet.StreamServerEndpointService, twisted.application.service.MultiService, twisted.names.secondary.SecondaryAuthorityService, twisted.runner.procmon.ProcessMonitor, twisted.words.protocols.jabber.component.Service

Implements interfaces: twisted.application.service.IService

View In Hierarchy

Base class for services.

Most services should inherit from this class. It handles the book-keeping responsibilities of starting and stopping, as well as not serializing this book-keeping information.

Instance Variable running A boolean which indicates whether the service is running.
Instance Variable name A str which is the name of the service or None.
Instance Variable parent An IServiceCollection which is the parent or None.
Method __getstate__ Undocumented
Method setName Set the name of the service.
Method setServiceParent Set the parent of the service. This method is responsible for setting the parent attribute on this service (the child service).
Method disownServiceParent Use this API to remove an IService from an IServiceCollection.
Method privilegedStartService Do preparation work for starting the service.
Method startService Start the service.
Method stopService Stop the service.
running = (source)

A boolean which indicates whether the service is running.

(type: int)
name = (source)

A str which is the name of the service or None.

parent = (source)

An IServiceCollection which is the parent or None.

def setName(self, name): (source)

Set the name of the service.

ParametersnameUndocumented (type: str)
RaisesRuntimeErrorRaised if the service already has a parent.
def setServiceParent(self, parent): (source)

Set the parent of the service. This method is responsible for setting the parent attribute on this service (the child service).

ParametersparentUndocumented (type: IServiceCollection)
RaisesRuntimeErrorRaised if the service already has a parent or if the service has a name and the parent already has a child by that name.
def disownServiceParent(self): (source)

Use this API to remove an IService from an IServiceCollection.

This method is used symmetrically with setServiceParent in that it sets the parent attribute on the child.

Returnsa Deferred which is triggered when the service has finished shutting down. If shutting down is immediate, a value can be returned (usually, None). (type: Deferred)
def privilegedStartService(self): (source)

Do preparation work for starting the service.

Here things which should be done before changing directory, root or shedding privileges are done.

API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.