Giter VIP home page Giter VIP logo

java_distributed's People

Contributors

shaohuahuang avatar

Watchers

 avatar  avatar  avatar

java_distributed's Issues

Implement TrackerStateGossipService

Every 0.5s, the user Gossip push out the TrackerState. If the recipient has a lower version, update the TrackerState, otherwise remains unchanged.

Second Game Process Join

  • player mark itself as backup

  • tracker register the player in the list

  • player sync with primary server, build communication with primary

  • Primary sync the Game State to backup.

Implement GameStateGossipService

Every 0.5s, the user should randomly gossip pull the state from other players. If the game version of other players is large, the use that state. Otherwise, remains unchanged.

Note: The reason we need it is because we want a player to get real-time update even though it is not making move request.

Third player joins the game

  • joins the game
  • gossip others to get the game state
  • sync TrackerState to primary server ----> sync to primary server
  • make a move and all three are updated

primary should check heart beat of backup

  • primary should check heart beat of backup
  • Gossip does not report whether server crash
  • when promote as primary, need to spin the scheduler
  • sync game state fail, will not find new backup server

Implement ServerSyncService

  1. Sync the updated GameState from primary server and backup server.
  2. Checking the heartbeat mutually (This is to prevent both servers from dying)

Implement MoveRequestService

Every time the player makes a move request, it will update primary server game state and get the updated game state as response.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.