Cluster Singleton Grain Service? #9959
Unanswered
AlgorithmsAreCool
asked this question in
Q&A
Replies: 1 comment 5 replies
-
|
Just spitballing, would a grain with a known, fixed ID (e.g. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So, I have a weird use case that i don't know if the in-box Orleans tools are a good fit for. Basically, i need a cluster-singleton persistent service. A Grain Service works just fine for this, except that it is replicated to all Silos (maybe they should be called Silo Services 😄).
I have taken to implementing a grain service, but with some fancy logic that basically elects a "leader" that directs the other follower instances. The "election" is just whatever Silo Address is sorted first in the list of active silos, which updates made on every ring size change. It kinda seems to work, but i wonder if there is a better way to tackle this?
The obvious alternative is to spawn an external "gateway" service outside of orleans that relays commands into the cluster, which works, but I was just curious if there was a way to handle this in an orleans native way.
The concrete usecase is a pub/sub subscription that needs to maintain a single persistent connection to the broker to send/receive commands.
Beta Was this translation helpful? Give feedback.
All reactions