8687.15.8
by Karl Fogel
Add the copyright header block to more files. |
1 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
3 |
||
2603
by Canonical.com Patch Queue Manager
Build daemon task sequencer/serialiser. r=spiv |
4 |
# Twisted Application Configuration file.
|
5 |
# Use with "twistd -y <file.tac>", e.g. "twistd -noy server.tac"
|
|
6 |
||
7 |
from twisted.application import service |
|
8 |
||
9 |
from canonical.buildd.sequencer import BuildSequencer |
|
10 |
||
11 |
# Construct the application
|
|
12 |
application = service.Application("BuildSequencer") |
|
13 |
||
14 |
class BuildSequencerService(service.Service): |
|
15 |
def __init__(self, buildSequencer): |
|
16 |
self.buildSequencer = buildSequencer |
|
17 |
||
18 |
def startService(self): |
|
19 |
# Kick everything off...
|
|
20 |
self.buildSequencer.scheduleCallback() |
|
21 |
||
22 |
||
23 |
# Construct the sequencer. It will automatically schedule the first job.
|
|
24 |
bseq = BuildSequencer() |
|
25 |
# Make a service out of the sequencer
|
|
26 |
bserv = BuildSequencerService(bseq) |
|
27 |
||
28 |
# Activate the service
|
|
29 |
BuildSequencerService(bseq).setServiceParent(application) |
|
30 |
||
31 |
# Falling off the end here passes into twisted's reactor.
|