1from __future__ import annotations
2
3from abc import ABC, abstractmethod
4from typing import Any
5
6
7class Chore(ABC):
8 """
9 Abstract base class for chores.
10
11 Subclasses must implement:
12 - run() method
13
14 Example:
15 @register_chore
16 class ClearExpired(Chore):
17 '''Delete sessions that have expired.'''
18
19 def run(self):
20 # ... implementation
21 return "10 sessions deleted"
22 """
23
24 @abstractmethod
25 def run(self) -> Any:
26 """Run the chore. Must be implemented by subclasses."""
27 pass