Mesh.Supervisor (Mesh v0.1.4)
View SourceMain supervisor for the Mesh actor system.
This supervisor manages all core components of the distributed actor system:
- Capability registry for node routing
- Actor registry and lifecycle management
- Shard ownership distribution
- Cluster membership tracking
Usage
To start Mesh in your application, add it to your supervision tree:
children = [
Mesh.Supervisor
]
Supervisor.start_link(children, strategy: :one_for_one)Cluster Setup
Mesh does not include cluster discovery. For multi-node setups, configure libcluster in your application:
children = [
{Cluster.Supervisor, [topologies, [name: MyApp.ClusterSupervisor]]},
Mesh.Supervisor
]Example topology configuration:
topologies = [
gossip: [
strategy: Cluster.Strategy.Gossip,
config: [
port: 45892,
if_addr: "0.0.0.0",
multicast_addr: "230.1.1.251",
multicast_ttl: 1
]
]
]Configuration
Configure the number of shards (default: 4096) in your config.exs:
config :mesh, shards: 4096
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.