Package buildbot :: Module locks :: Class SlaveLock
[frames] | no frames]

Class SlaveLock

source code

util.ComparableMixin --+    
                       |    
              BaseLockId --+
                           |
                          SlaveLock

I am a semaphore that limits simultaneous actions on each buildslave.

Builds and BuildSteps can declare that they wish to claim me as they run. Only a limited number of such builds or steps will be able to run simultaneously on any given buildslave. By default this number is one, but my maxCount parameter can be raised to allow two or three or more operations to happen on a single buildslave at the same time.

Use this to protect a resource that is shared among all the builds taking place on each slave, for example to limit CPU or memory load on an underpowered machine.

Each buildslave will get an independent copy of this semaphore. By default each copy will use the same owner count (set with maxCount), but you can provide maxCountForSlave with a dictionary that maps slavename to owner count, to allow some slaves more parallelism than others.

Nested Classes
  lockClass
Instance Methods
 
__init__(self, name, maxCount=1, maxCountForSlave={}) source code

Inherited from BaseLockId: access, defaultAccess

Inherited from util.ComparableMixin: __cmp__, __hash__, __providedBy__, __provides__

Class Variables
  compare_attrs = ['name', 'maxCount', '_maxCountForSlaveList']

Inherited from util.ComparableMixin: __implemented__