moo.sdk.tasks.schedule_continuation
- moo.sdk.tasks.schedule_continuation(remaining_items, verb, msg=None)
Schedule a continuation task carrying the PKs of remaining_items and notify the current player.
Intended for use inside long-running verbs that iterate over many objects. The continuation verb (e.g.
audit_batch,reload_batch) receivesargs[0]as the list of PKs and dispatches onverb_name.Usage:
for i, item in enumerate(items): if task_time_low(): schedule_continuation(items[i:], this.get_verb("audit_batch")) return # ... process item
- Parameters:
remaining_items – iterable of Objects (or any model with
.pk)verb – Verb instance to invoke for the continuation
msg – optional override for the progress message shown to the player