c.l.i.l.ITunableLoop(Interface) : interface documentation

Part of canonical.launchpad.interfaces.looptuner View In Hierarchy

Known implementations: canonical.database.multitablecopy.PouringLoop, canonical.launchpad.utilities.looptuner.TunableLoop, canonical.librarian.librariangc.ExpireAliases, canonical.librarian.librariangc.UnreferencedContentPruner, canonical.librarian.librariangc.UnreferencedLibraryFileAliasPruner, lp.archivepublisher.utils.PublishingTunableLoop, lp.bugs.scripts.bugtasktargetnamecaches.BugTaskTargetNameCachesTunableLoop, lp.bugs.scripts.cveimport.CveUpdaterTunableLoop, lp.hardwaredb.scripts.hwdbsubmissions.ProcessingLoop, lp.translations.scripts.fix_translation_credits.CreditsFixer, lp.translations.scripts.migrate_variants.POFileVariantReplacer, lp.translations.scripts.migrate_variants.TranslationMessageVariantReplacer, lp.translations.scripts.remove_obsolete_translations.DeletionLoopRunner, lp.translations.scripts.verify_pofile_stats.Verifier

Interface for self-tuning loop bodies to be driven by LoopTuner.

To construct a self-tuning batched loop, define your loop body as a class implementing TunableLoop, and pass an instance to your LoopTuner.

Method isDone Is this loop finished?
Method __call__ Perform an iteration of the loop.
def isDone():
Is this loop finished?

Once this returns True, the LoopTuner will no longer touch this object.

def __call__(chunk_size):
Perform an iteration of the loop.

The chunk_size parameter says (in some way you define) how much work the LoopTuner believes you should try to do in this iteration in order to get as close as possible to your time goal.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.