Skip to content

Instantly share code, notes, and snippets.

@ScottSturdivant
Last active February 12, 2016 18:41
Show Gist options
  • Save ScottSturdivant/9ff4d9834325a9029fe9 to your computer and use it in GitHub Desktop.
Save ScottSturdivant/9ff4d9834325a9029fe9 to your computer and use it in GitHub Desktop.
dag = DAG(config=config)
class DAGService(service.Service):
def startService(self):
# Something here in the dag.run() ultimately calls 'reactor.stop()' if a fatal error is encountered.
# This winds up raising ReactorNotRunning when it is called.
dag.run()
# This will hold the services that combine to form DAG
top_service = service.MultiService()
dag_service = DAGService()
dag_service.setServiceParent(top_service)
# The Mail Service receives incoming emails from DLP and processes them.
mail_service = make_mail_service(dag)
mail_service.setServiceParent(top_service)
application = service.Application('dag')
# This hooks the collection we made to the application
top_service.setServiceParent(application)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment