counter-cluster
A small cluster of two roles (Standard §12): edge nodes serve the Gate service, store nodes keep the state of the
sharded actor Counter in their replicated storage. The same binary runs on every node; the role decides what a node does.
oxl dev --nodes 4 # four local nodes 127.0.0.1:7000..7003, roles assigned automatically
oxl test # one in-process node with every roleoxl dev rebuilds and restarts the nodes when a source file changes; the log of each node is
<data-dir>/nX/stdout.log. A leader task on the edge role (runs leader("traffic")) calls Gate.add(7, 1) every
two seconds, so the log shows the counter growing; the actor is activated on the node that owns its shard and moves
(with its state) when nodes come and go. Try kill on one of the node processes listed by oxl dev.
Файлы проекта#
Исходник: examples/counter-cluster