z4j-taskiqscheduler
The taskiq-scheduler adapter for z4j.
Surfaces taskiq-scheduler periodic jobs on the dashboard's Schedules
page as list/read inventory. Delete is advertised only for a custom source
that overrides taskiq's unsupported delete_schedule default.
Compatibility
- TaskIQ 0.11+ (no upper bound)
- Python 3.11+
Full per-adapter matrix at https://docs.z4j.com/reference/compatibility/.
What it ships
| Capability | Notes |
|---|---|
| List schedules | jobs returned by the configured taskiq-scheduler source |
| Read | by registered name |
| Delete | advertised only when the configured source implements it; label-defined schedules require a code change and redeploy |
| Boot inventory | full snapshot at agent connect; existing schedules show up without editing |
taskiq-scheduler schedules are typically defined declaratively (label source, JSON file, or label decorators), so create / update are intentionally out of scope, those need a deploy round-trip. taskiq also has no enable/disable toggle or trigger-now primitive, so the dashboard hides those actions for this adapter.
Install
pip install z4j-taskiq z4j-taskiqscheduler
import asyncio
import logging
import os
from taskiq import TaskiqEvents, TaskiqScheduler
from taskiq.schedule_sources import LabelScheduleSource
from z4j_bare import install_agent
from z4j_taskiq import TaskiqEngineAdapter, attach_to_broker
from z4j_taskiqscheduler import TaskiqSchedulerAdapter
source = LabelScheduleSource(broker)
scheduler = TaskiqScheduler(broker=broker, sources=[source])
engine = TaskiqEngineAdapter(broker=broker)
attach_to_broker(broker, adapter=engine)
_z4j_installed = False
logger = logging.getLogger(__name__)
@broker.on_event(TaskiqEvents.CLIENT_STARTUP)
async def install_z4j_after_scheduler_sources(_state) -> None:
global _z4j_installed
if _z4j_installed:
return
owner_loop = asyncio.get_running_loop()
try:
scheduler_adapter = TaskiqSchedulerAdapter(
source=source,
source_loop=owner_loop,
)
install_agent(
engines=[engine],
schedulers=[scheduler_adapter],
brain_url="https://brain.example.com",
token="z4j_agent_...",
project_id="my-project",
hmac_secret=os.environ["Z4J_HMAC_SECRET"],
)
except Exception as exc:
logger.error(
"z4j TaskIQ scheduler install failed (%s)",
type(exc).__name__,
)
return
_z4j_installed = True
Run this module with TaskIQ's scheduler CLI. It starts each configured source
before calling broker startup, so CLIENT_STARTUP installs z4j on the broker's
real owner loop after this LabelScheduleSource is live. The guard makes a
repeated callback reuse the same adapter and agent. The CLI owns broker startup
and shutdown; do not call either lifecycle method from this module.
For a custom async schedule source, always pass that same verified loop as
source_loop. z4j marshals get_schedules and supported delete_schedule
calls to it once, without retrying an ambiguous delete. Only the exact stock
LabelScheduleSource, whose read is an in-memory registry snapshot, supports
an unbound direct read; custom sources fail closed until an owner is supplied.
Pairs with
z4j-taskiq, engine adapter
Reliability
- Inventory failures skip the snapshot rather than publishing an authoritative empty schedule set.
- Custom source reads and deletes stay on their explicit owner event loop; cancellation is forwarded and z4j does not retry the operation.
- The adapter does not rewrite schedule definitions. Delete is advertised and delegated only when a custom source overrides taskiq's failing default; the standard label source remains read-only.
Documentation
Full docs at docs.z4j.com/schedulers/taskiq-scheduler/.
License
Apache-2.0, see LICENSE.
Links
- Homepage: https://z4j.com
- Documentation: https://docs.z4j.com
- PyPI: https://pypi.org/project/z4j-taskiqscheduler/
- Issues: https://github.com/z4jdev/z4j-taskiqscheduler/issues
- Changelog: CHANGELOG.md
- Security: security@z4j.com (see SECURITY.md)
Metadata
Release files for z4j-taskiqscheduler 1.12.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| z4j_taskiqscheduler-1.12.1.tar.gz | 14.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| z4j_taskiqscheduler-1.12.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.3 kB
Release files / z4j_taskiqscheduler-1.12.1.tar.gz
| Download URL | z4j_taskiqscheduler-1.12.1.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a661414a4aed263f8ca41357aafbdb978c1de96f0600554f65371560deb39401
|
|
BLAKE2b-256 checksum How to use checksums |
17a0cbde36889aa3745a00c5c4e835100e693744343b27ae00442afd0a9e2152
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / z4j_taskiqscheduler-1.12.1-py3-none-any.whl
| Download URL | z4j_taskiqscheduler-1.12.1-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62d3d219a70e7b96ee3a27779f18e8cf0f2ac105db9e17a19ede5ef92f9e9dc2
|
|
BLAKE2b-256 checksum How to use checksums |
b45a5b59e503016e870c6cb2ccdbf3cd47986733938636bd69fce3cb3321901e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|