Reputation: 61
Hey I'm doing some reading and watching some videos on AKKA.Net and am loving what I am seeing. I want to try AKKA.net in an existing application I have but I need help clarifying some things
Scenario
I want to create an Akka.net cluster with:
3 Nodes/ Machines
a shared resource (a counter) between them.
a shared Resource statistics readable from all nodes
Whenever a node cashes a ticket it will take the value of the counter and increment it by one then update the counter. No two tickets should have the same counter value. The shared statistics info is to hold the value if tickets cashed in so it should be deployed to all nodes in the cluster.
Questions
Upvotes: 2
Views: 309
Reputation: 1197
If you can't access the actor system to request a "counter" or identifier, then use something like a GUID to uniquely identify a resource (Guid.NewGuid()
). If you require a global integer counter then you'll have to implement an actor which tracks this counter and dispenses new values on demand.
Yes, you can listen to Cluster gossip events and determine when a node has been disconnected and decide if it is no longer available:
http://getakka.net/docs/clustering/cluster-extension#working-with-cluster-gossip
Upvotes: 1