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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file 3tears_scheduled_jobs-0.23.0.tar.gz.
File metadata
- Download URL: 3tears_scheduled_jobs-0.23.0.tar.gz
- Upload date:
- Size: 65.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8674018867a689037bd6c00507f54f75be5484b75b4842a9de2a5334bb56799b
|
|
| MD5 |
eed8eff6c1e1642faa09a7eef3affd54
|
|
| BLAKE2b-256 |
58f2ced2feb5681ffaff6097001b593ba1deef12522ab03daccce803cc37f3ee
|
Provenance
The following attestation bundles were made for 3tears_scheduled_jobs-0.23.0.tar.gz:
Publisher:
release.yml on pacepace/3tears
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3tears_scheduled_jobs-0.23.0.tar.gz -
Subject digest:
8674018867a689037bd6c00507f54f75be5484b75b4842a9de2a5334bb56799b - Sigstore transparency entry: 2337660965
- Sigstore integration time:
-
Permalink:
pacepace/3tears@e98b2b464cc9a6374a8f049e50a0a6179c863e7b -
Branch / Tag:
refs/tags/v0.23.0 - Owner: https://github.com/pacepace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e98b2b464cc9a6374a8f049e50a0a6179c863e7b -
Trigger Event:
push
-
Statement type:
File details
Details for the file 3tears_scheduled_jobs-0.23.0-py3-none-any.whl.
File metadata
- Download URL: 3tears_scheduled_jobs-0.23.0-py3-none-any.whl
- Upload date:
- Size: 50.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb58c2dd72e5bdda65468b65c333a735bb261c8b333f38f01ec82f026953a392
|
|
| MD5 |
367d853e9807304a1dcdac5fe13ff56e
|
|
| BLAKE2b-256 |
238fdd26fe95ce047ba64a0483e93627853c17e6847f2ce9cc40e6e26a5d3915
|
Provenance
The following attestation bundles were made for 3tears_scheduled_jobs-0.23.0-py3-none-any.whl:
Publisher:
release.yml on pacepace/3tears
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
3tears_scheduled_jobs-0.23.0-py3-none-any.whl -
Subject digest:
fb58c2dd72e5bdda65468b65c333a735bb261c8b333f38f01ec82f026953a392 - Sigstore transparency entry: 2337661106
- Sigstore integration time:
-
Permalink:
pacepace/3tears@e98b2b464cc9a6374a8f049e50a0a6179c863e7b -
Branch / Tag:
refs/tags/v0.23.0 - Owner: https://github.com/pacepace
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e98b2b464cc9a6374a8f049e50a0a6179c863e7b -
Trigger Event:
push
-
Statement type: