Skip to main content

z4j framework-free agent bootstrapper (Apache 2.0)

Project description

z4j-bare

PyPI version Python License

The framework-free agent runtime for z4j.

Bootstraps a z4j agent inside any Python process, Celery worker, RQ worker, Dramatiq actor, plain script, custom service, and connects it to z4j over an authenticated WebSocket. Used directly when there's no framework adapter (z4j-django / z4j-flask / z4j-fastapi); used indirectly by those framework adapters too.

What it ships

  • Agent runtime, connect, authenticate, supervise, reconnect with bounded backoff
  • Outbound buffer, every event written to a local SQLite ring before going out on the wire; durable across short brain outages and agent restarts
  • Engine signal hooks, wired up by whichever engine adapter you install (z4j-celery, z4j-rq, etc.); the runtime drains them into the buffer
  • Schedule inventory, emits a full snapshot at boot, on a periodic timer (default 15 min), and on demand from the brain's Sync now command. Existing schedules show up automatically.
  • Command dispatcher, receives operator actions from the brain (retry, cancel, restart, schedule.fire, schedule.resync, etc.) and routes them to the right adapter

Install

pip install z4j-bare

Most users install a framework adapter (z4j-django / z4j-flask / z4j-fastapi) which pulls z4j-bare automatically.

Quick start (framework-free worker)

from z4j_bare import install_agent
from z4j_celery import CeleryEngineAdapter

install_agent(
    engines=[CeleryEngineAdapter(celery_app=app)],
    brain_url="https://brain.example.com",
    token="z4j_agent_...",
    project_id="my-project",
)

Reliability

  • No exception from the agent ever propagates back into your worker / signal handler / request path. Every brain interaction is wrapped in a top-level try/except.
  • Events buffer locally when z4j is unreachable. Workers never block on network I/O.
  • Supervisor reconnects on every transient failure (network, TLS, protocol mismatch) with bounded backoff.

Documentation

Full docs at z4j.dev/frameworks/bare/.

License

Apache-2.0, see LICENSE.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z4j_bare-1.5.0.tar.gz (103.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z4j_bare-1.5.0-py3-none-any.whl (100.4 kB view details)

Uploaded Python 3

File details

Details for the file z4j_bare-1.5.0.tar.gz.

File metadata

  • Download URL: z4j_bare-1.5.0.tar.gz
  • Upload date:
  • Size: 103.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_bare-1.5.0.tar.gz
Algorithm Hash digest
SHA256 d53b05b3a2b78525da736c9eb8d32936c11642638a4199ab14f7cce06a5ef7d3
MD5 5bc4bcbcf85b68866a7ac12e70af340a
BLAKE2b-256 7d151b4c684d1ef8c5aaae3f4360303919859d1d62319cccb317860d643b785e

See more details on using hashes here.

File details

Details for the file z4j_bare-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: z4j_bare-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 100.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_bare-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00a1b1bd7bbb2c5a7a567191f51b8e67c8877ef8a9d76a6eca3a192f230220ae
MD5 cae2ba266cf681f3f4e55a4d9fbd338e
BLAKE2b-256 69ae4b399e8add4863a81dc5ec7489fb1831c24d1a2c2d1e8faa6d6bfd92dd1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page