Pre-warming helper for application startup. Run a set of preload callables (optionally in parallel) and get a readiness report covering successes and failures.
pip install flufferfrom fluffer import warm
def load_config():
return {"env": "dev"}
def connect_cache():
return True
report = warm([load_config, connect_cache], parallel=True)
assert report.ready is True
assert len(report.tasks) == 2- Warm caches, configs, and connections before serving traffic
- Parallel by default; sequential when you need order
- Failures are reported, not swallowed — check
report.ready
| Symbol | Description |
|---|---|
warm(callables, parallel=True) |
Run preload tasks; return report |
WarmResult |
Aggregate report; .ready, .failures, .tasks |
WarmTaskResult |
Per-task name / ok / result / error |
Part of the coldbricks micro-library suite (small, typed, zero-dependency helpers):
| Package | Role |
|---|---|
buzzkill |
Guaranteed shutdown callbacks |
aftercare |
Reverse-order teardown |
| fluffer | Startup pre-warm |
edging |
Token-bucket rate limit |
readback |
Echo-confirmation validation |
hearback |
Output re-validation decorator |
agecheck |
Timezone-correct age thresholds |
transponder |
State broadcast on change |
pip install -e ".[dev]"
pytest -q
ruff check .
mypy srcThis is an early 0.1.0 release (Alpha) with active development planned:
- Async/await warm paths
- Timeout and cancellation per task
- Integration hooks for health endpoints
MIT © Coldbricks — coldbricks@gmail.com