Skip to main content

Cluster plugin for evoid — connect multiple nodes into a unified system

Project description

PyPI Python License

evoid-cluster

Multi-node clustering — Intent Handler system

Quick StartIntent HandlerArchitectureAPI


Quick Start

uv add evoid-cluster

Method 1: Intent Handler (Recommended)

from evoid_cluster import register_handlers

# Register cluster as Intent handlers
register_handlers(config={
    "node": {"id": "node-1", "host": "0.0.0.0", "port": 9100},
    "cluster": {"secret": "my-secret"},
})

Method 2: Direct API

from evoid_cluster import ClusterBridge, ClusterConfig

config = ClusterConfig.from_toml("cluster.toml")
bridge = ClusterBridge(config)

Intent Handler

evoid-cluster registers inter-node communication as Intent handlers.


Architecture

Node A (users)  ←──WebSocket──→  Node B (chat)
       ↕                              ↕
Node C (database) ←──WebSocket──→  Node D (game)

Each node:

  1. Announces its services via Intent through the message bus
  2. ClusterBridge forwards intents to remote nodes
  3. Only Intent and Result flow between nodes — never raw data

Configuration

TOML (separate file)

[node]
id = "node-1"
host = "0.0.0.0"
port = 9100

[cluster]
secret = "my-cluster-secret"

[cluster.peers]
"node-b" = { host = "192.168.1.11", port = 9100 }

API

register_handlers(config: dict)

Register cluster as Intent handlers.

ClusterBridge Methods

Method Signature Description
start async start() Start cluster node
stop async stop() Stop cluster node
broadcast async broadcast(intent) Send intent to all peers

DI Integration

All plugins register with evoid-di for automatic service discovery and fault tolerance.

from evoid_di import di

# Resolve with fallback
storage = di.resolve_with_fallback("storage.postgresql")
# Tries: postgresql → sqlite → redis → cluster peers → None

Dependencies

  • evoid>=0.4.0
  • websockets>=12.0

Links

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

evoid_cluster-0.1.2-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file evoid_cluster-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: evoid_cluster-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for evoid_cluster-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bd955e9db7b8f055b2d78b4759ee8bda12afa02acf81f5578965e95cc9cf29d0
MD5 ada3faf081f76f0a01485285393f7da2
BLAKE2b-256 ec5f79d679d91a04ed4415d5ab15513c6e865e9cb7aa8576f61af810698ab2e7

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