Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.leader() - Resilient tagging of certain instances of a Ravel app #220

Open
Ghnuberath opened this issue Oct 22, 2017 · 0 comments
Open
Assignees
Labels

Comments

@Ghnuberath
Copy link
Member

Summary

When a new leader type is declared, a set of Ravel app instances connected to the same Redis server will ensure that one replica is always denoted as that leader type. If the node which is the current leader for a certain leader type fails, another one is elected to take its place (via Raft consensus).

Proposed API

leader declaration

// ... 
app.leader('typeName');
app.init() // perform leader election for 'typeName' after init (postinit).
app.listen() // leaders always start before followers

example leader usage

@prelisten({leader: 'typeName'})
myMethod () {
  // will only execute on the leader for type typeName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant