Task discovery
Retry and bulk retry work from the task names z4j has already seen. Every event the agent forwards names its task, and the brain keeps one row per task in the tasks table. Engine adapters can also enumerate what their engine could run, each in the only way its engine allows, but that enumeration never reaches z4j (see below).
What each adapter can enumerate
Section titled “What each adapter can enumerate”- Celery: reads
celery_app.tasks(skipping Celery's owncelery.*tasks) and merges it with a static scan. The scan is anastparse, never an import, oftasks.py,celery.py,celery_tasks.pyand atasks/package under each path the framework adapter supplies (for Django, theINSTALLED_APPSdirectories); files over 2 MiB and symlinks are skipped. Runtime entries win on conflict, and scan-only entries are flagged as declared but not loaded. - Dramatiq: walks the broker's
actorsmapping, one definition per registered actor. - RQ: has no registry. The adapter walks each queue plus its Started, Finished and Failed job registries, up to 500 jobs per registry, and reports every distinct
func_nameit finds: you see what has actually run. - Huey: reads the Huey instance's in-process task registry.
- arq: has no registry. The adapter reports the function names the caller passed when it was configured.
- taskiq: reads
broker.get_all_tasks().
What z4j does with names
Section titled “What z4j does with names”Nothing in the agent runtime calls an adapter's discovery method or subscribes to its registry changes, so the enumeration above is not sent to z4j. The Celery adapter's dev-mode file watcher (Z4J_DEV_MODE=true with the z4j-bare[watcher] extra) is the only code that re-runs discovery, and it is started from that unused subscription. The brain, for its part, logs and discards any registry_delta frame it receives.
The task names z4j knows are the ones observed in the tasks table, written from events. Bulk retry resolves task names from those rows (a client-supplied name list is refused and audited), and the dashboard has no enqueue-task form and no per-agent registry view.
Caveats
Section titled “Caveats”- A task that has never produced an event is unknown to z4j until it runs.
- Two agents with different import sets differ only in the events they emit; z4j holds the union of what it has seen, not a per-agent registry.