Skip to content

snakemode/leader-election-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leader Election in the browser with Ably

When you run this application in your browser, and the first client joins, it'll be elected the leader and start incrementing the counter.

Subsequent clients that join will receive the counter messages and update their UI. If the leader closes their browser, the election process will run and a new leader will be elected who will take over updating and distributing the counter messages from where the last leader left off.

Running the application

In order to run this demo you will need node and npm.

Clone the repository and run:

npm install
npm run start

Then open the browser to http://localhost:8000.

You'll need to edit Swarm.ts to provide an Ably API Key of your own for the example application to work.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 79.1%
  • HTML 13.4%
  • Dockerfile 6.4%
  • CSS 1.1%