Skip to main content

RXON (Reverse Axon) - Lightweight Inter-node Reverse Communication Protocol.

Project description

RXON (Reverse Axon) Protocol

EN | ES | RU

License: MIT Python 3.11+ Typing: Typed

RXON (Reverse Axon) is a lightweight reverse-connection inter-service communication protocol designed for the HLN (Hierarchical Logic Network) architecture.

It serves as the "nervous system" for distributed multi-agent systems, connecting autonomous nodes (Holons) into a single hierarchical network.

🧬 The Biological Metaphor

The name RXON is derived from the biological term Axon (the nerve fiber). In classic networks, commands typically flow "top-down" (Push model). In RXON, the connection initiative always comes from the subordinate node (Worker/Shell) to the superior node (Orchestrator/Ghost). This is a "Reverse Axon" that grows from the bottom up, creating a channel through which commands subsequently descend.

✨ Key Features

  • Pluggable Transports: Full abstraction from the network layer. The same code can run over HTTP, WebSocket, gRPC, or Tor.
  • Zero Dependency Core: The protocol core has no external dependencies (standard transports use aiohttp and orjson).
  • Strictly Typed: All messages (tasks, results, heartbeats) are defined via strictly typed models for maximum performance and correctness.
  • Blob Storage Native: Built-in support for offloading heavy data via S3-compatible storage (rxon.blob).

🏗 Architecture

The protocol is divided into two main interfaces:

  1. Transport (Worker side): Interface for initiating connections, retrieving tasks, and sending results.
  2. Listener (Orchestrator side): Interface for accepting incoming connections and routing messages to the orchestration engine.

Usage Example (Worker side)

from rxon import create_transport, WorkerRegistration

# 1. Create transport (automatically selects HttpTransport based on URL scheme)
transport = create_transport(
    url="https://orchestrator.local",
    worker_id="gpu-01",
    token="secret-token"
)

await transport.connect()

# 2. Register
await transport.register(reg_payload)

# 3. Poll for tasks
task = await transport.poll_task(timeout=30)

🛡️ Error Handling

RXON uses a dedicated exception hierarchy grounded in RxonError. It also defines standardized error codes for task results:

  • TIMEOUT_ERROR: The worker could not finish in time.
  • LATE_RESULT: (Response) The orchestrator refused the result because the deadline has passed.
  • STALE_TASK: (Response) The orchestrator refused the result because the task has been reassigned or the job state has moved on.
  • RESOURCE_EXHAUSTED_ERROR: Transient failure due to lack of local resources.

🧪 Testing

The library includes a MockTransport to simplify testing Workers in isolation without running a real Orchestrator.

from rxon.testing import MockTransport

# Use standard factory with mock:// scheme
transport = create_transport("mock://", "test-worker", "token")
await transport.connect()

# Inject tasks directly
transport.push_task(my_task_payload)

📜 License

The project is distributed under the MIT License.


Mantra: "The RXON is the medium for the Ghost."

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

rxon-1.0b3.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

rxon-1.0b3-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file rxon-1.0b3.tar.gz.

File metadata

  • Download URL: rxon-1.0b3.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rxon-1.0b3.tar.gz
Algorithm Hash digest
SHA256 8db019aae956cb124ed2b408655671bbbdcedf3065228bcd04a3f3f4fa5e7067
MD5 c97ca0b5a1713a97c5427737c6eb1f1d
BLAKE2b-256 03a632902b25d38552f04621b7a1e49432ed8688ae315617fd38ea5cbaa2f846

See more details on using hashes here.

File details

Details for the file rxon-1.0b3-py3-none-any.whl.

File metadata

  • Download URL: rxon-1.0b3-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for rxon-1.0b3-py3-none-any.whl
Algorithm Hash digest
SHA256 a747d0e5a97c2a4794feb3fa68cd481ca571cce9cc068641f919bae1076e1217
MD5 90f885271772fdaa411f75bbff75db7e
BLAKE2b-256 e92758f2e73c5698828e6a03cb7369911358015ffd9d25147a015118d4add7c8

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