Distributed Reactive Orchestration Nodes Environment
Project description
DRONE
Distributed Reactive Orchestration Nodes Environment
DRONE is a Python framework built on top of Atom that turns reactive object graphs into distributed ones. When a member value changes in one process, it is automatically pushed through a message broker to all subscribers on any machine — triggering their local Atom observers as if the change had happened locally.
Installation
pip install drones
A running Redis instance is required for the default RedisBroker.
Quick start
Publisher (process A)
from atom.api import Atom, Float
from drones import Drone, RedisBroker, drone
@drone
class MarketFeed(Atom):
price = Float().tag(drone_publish="price")
Drone.bind(pubsub_channel="my-app", broker=RedisBroker("redis://localhost:6379"))
feed = MarketFeed()
feed.price = 185.0 # published to every subscriber on the "my-app" channel
Subscriber (process B)
from atom.api import Atom, Float, Int, observe
from drones import Drone, RedisBroker, drone
@drone
class Portfolio(Atom):
price = Float().tag(drone_node="price") # fed remotely
quantity = Int(10)
total = Float()
@observe("price")
def _refresh(self, change):
self.total = self.price * self.quantity
Drone.bind(pubsub_channel="my-app", broker=RedisBroker("redis://localhost:6379"))
portfolio = Portfolio()
# portfolio.price is updated whenever MarketFeed.price changes in process A,
# firing _refresh through Atom's native observation.
See the examples/ directory for a runnable publisher/subscriber
pair, and SPEC.md for the full design specification.
Core concepts
@drone— class decorator that instruments anAtomsubclass.drone_publish="name"— tag a member so its changes are published undername.drone_node="name"— tag a member so it receives updates forname.drone_scope="instance"— restrict delivery to the instance whosedrone_idmatches (node name on the wire becomesname.<drone_id>).- Broker — pluggable transport (
DroneBrokerABC);RedisBrokerships by default. - Serializer — pluggable (
DroneSerializerABC);PickleSerializeris the default.
Development
This project uses pixi for local development.
pixi run test # run the test suite
pixi run lint # ruff check
pixi run format # ruff format
pixi run typecheck # mypy
Releasing
Versions are derived from git tags via
hatch-vcs. To publish a release, push a
tag and the GitHub Actions workflow builds and publishes to PyPI using
trusted publishing:
git tag v0.1.0
git push origin v0.1.0
License
Project details
Release history Release notifications | RSS feed
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 drones-0.1.0.tar.gz.
File metadata
- Download URL: drones-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8889220ebd838b9accf5a5e363d39ba16d69b97d72f0086bb85767fc5f0e4208
|
|
| MD5 |
f9b471ef372ff75adbd588334f561770
|
|
| BLAKE2b-256 |
98e5333a48f9ea65b98614e0eb9de03fbd81a30fbfc66e00323e92930817400e
|
Provenance
The following attestation bundles were made for drones-0.1.0.tar.gz:
Publisher:
main.yml on gabrielcnr/drones
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drones-0.1.0.tar.gz -
Subject digest:
8889220ebd838b9accf5a5e363d39ba16d69b97d72f0086bb85767fc5f0e4208 - Sigstore transparency entry: 1859888823
- Sigstore integration time:
-
Permalink:
gabrielcnr/drones@82c1ceab772d95533f10add6723019ac2b54632e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gabrielcnr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@82c1ceab772d95533f10add6723019ac2b54632e -
Trigger Event:
push
-
Statement type:
File details
Details for the file drones-0.1.0-py3-none-any.whl.
File metadata
- Download URL: drones-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def8283e5846765d44daa8ee39760259932ce3ae035675950900c6f108d141db
|
|
| MD5 |
370015059512c2fe29aa723554e76679
|
|
| BLAKE2b-256 |
615c0d5ce4cab83120c911eb95c9a0f55229621effc23810deb755d2f70fd728
|
Provenance
The following attestation bundles were made for drones-0.1.0-py3-none-any.whl:
Publisher:
main.yml on gabrielcnr/drones
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drones-0.1.0-py3-none-any.whl -
Subject digest:
def8283e5846765d44daa8ee39760259932ce3ae035675950900c6f108d141db - Sigstore transparency entry: 1859888859
- Sigstore integration time:
-
Permalink:
gabrielcnr/drones@82c1ceab772d95533f10add6723019ac2b54632e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/gabrielcnr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@82c1ceab772d95533f10add6723019ac2b54632e -
Trigger Event:
push
-
Statement type: