3tears-scheduled-jobs
A generic, payload-agnostic, multipod-safe scheduled-jobs core. Every agent/skill/webhook/conversation-specific concept is stripped out, leaving only the scheduling machinery.
What it gives you:
scheduled_tick_job(...)-- one cross-pod-locked tick pump. Acquire thenats_distributed_lockat a caller-supplied key; onLockHeldskip silently; onKvErrordegrade open (the per-row optimistic-CAS is the real guard); sweep abandoned in-flight fires per kind group; enumerate due rows of the routed kinds; per-row CAS-claim + reschedule; invoke the handler registered for that row'skind; drift / missed-fire accounting; per-row failure isolation. Takes the store(s), aDispatchRoutestable, and the NATS client as parameters, with no domain knowledge.- Per-
kindrouting, and an unrouted kind is inert. The pump'skind -> handlertable is matched EXACTLY -- no wildcard, no default handler, no fall-through -- and it also scopes the due-row scan (a SQL predicate, not a Python filter) and the reaper sweep. A row whose kind has no handler is refused with anunrouted_kindfailure metric and an ERROR event, and is deliberately not claimed, so the occurrence survives until its handler is registered. Silent misdelivery is the failure this prevents: a row absorbed by another kind's dispatcher does that dispatcher's work and records it as a success. - Per-
kindreap thresholds.dispatch_reap_after_seconds_by_kindoverridesDEFAULT_DISPATCH_REAP_AFTER_SECONDSper kind, so a kind whose work legitimately runs for hours is not reaped on the 15-minute baseline. Kinds sharing a threshold sweep in one query. Note the age is measured from dispatch start, not last activity, so the threshold alone only moves the false-reap cliff -- pair it with progress-conditioned renewal in the executor. - A distinct lock key per pump.
JobConfig.tick_lock_keydefaults toDEFAULT_TICK_LOCK_KEY; consumers running more than one pump in a process MUST vary it, or the pumps serialise against each other for no reason. compute_next_fire_at(...)-- the pure reschedule math for every schedule type (daily_at,every_n_hours,random_within_window,one_shot_at,cron,relative_delay,interval) and both missed-fire policies (coalesce,catch_up). Thecronbranch imports APScheduler lazily, so non-cron consumers pay nothing.ScheduleStore/FireStoreProtocols -- the exact surface the tick engine calls. The engine depends only on these, so a typed consumer collection can implement them.- A default store --
ScheduledJobEntity/JobFireEntity+ collections +scheduled_jobs/job_firestable factories + a v001 migration, keyed on an opaquekind(TEXT) +payload(JSONB). A simple consumer can use it as-is with no table of its own. - Generic config / events / metrics -- a
JobConfigprotocol, the tick / fire / drift event-name constants, and cardinality-bounded Prometheus instruments.
The engine is pure-async, one tick per call with no internal polling.
Drive cadence with whatever scheduler you like (an APScheduler
IntervalTrigger, a while True: await asyncio.sleep(...), and so on). The
engine does not own the scheduler.
Release files for 3tears-scheduled-jobs 0.46.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| 3tears_scheduled_jobs-0.46.0.tar.gz | 75.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 3tears_scheduled_jobs-0.46.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 130.8 kB
Release files / 3tears_scheduled_jobs-0.46.0.tar.gz
| Download URL | 3tears_scheduled_jobs-0.46.0.tar.gz |
|---|---|
| Size | 75.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a3ef952fa31b61ca94ae05f0e9c527e171f9892806178234b508411d39ccc4ef
|
|
BLAKE2b-256 checksum How to use checksums |
03d33f2d7334068c94ebb3338c21fc274d08491470dacf22faeeadead3bd474e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / 3tears_scheduled_jobs-0.46.0-py3-none-any.whl
| Download URL | 3tears_scheduled_jobs-0.46.0-py3-none-any.whl |
|---|---|
| Size | 55.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ed1bac48c1cfcdc5697dd54e1c97cd54fc91af00b92b7ce2fcac643d8a9deee5
|
|
BLAKE2b-256 checksum How to use checksums |
dc8347afaddbbecebc4fb53562cd4bfa3f4112c2f0fc10a9c5c0c9aa429a5117
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log