Giter Club home page Giter Club logo

message-passing-system-using-gwt's Introduction

Message Passing System using GWT

DESCRIPTION

This project is a distributed system built using the Google Web Toolkit (GWT) technology. The purpose of this project is to showcase how to implement a message-passing system using Lamport clock time and total ordering of events, with communication among browser windows acting as independent processes.


Running the Application

  1. To integrate the files with suitable IDE's follow the GWT_README text file.
  2. After doing so , you can either attach an ANT build script to the source folder (or) open terminal in the folder location and ant clean to clean any residual build files adn ant devmode to run the program in developer mode.


    Functionality :

    Client Code

    In the client code, each node maintains a local clock using the variable <code>'lamportClock'</code>. The initial value of the clock is 0, and every time an event occurs, the node increments its local clock value by 1.
    

    The Lamport clock algorithm is implemented in two places in the client code: when sending a message and when receiving a message.

    When sending a message, the local clock value is used as the timestamp of the message. Before sending the message, the serverLamport() method is called, which updates the local clock value based on the global clock value received from the server.

    This ensures that the timestamp of the message is greater than any previously sent message. The message is then sent using the GWT RPC mechanism.

    When receiving a message, the local clock value is updated based on the global clock value received from the server using the serverLamport() method. This ensures that the local clock value is synchronized with the global clock value. The local clock value is then incremented by 1, and the message is processed.

    In addition to the local clock value, each node maintains a process ID, which is used to identify the sender and receiver of the message. The process IDs are used as the second component of the timestamp.

    Server Code

    In the server code, the Lamport clock algorithm is implemented in two methods:

    globalClock(int clientLamportTime)

    This method takes an integer clientLamportTime as input and returns the server's Lamport time. It updates the server's Lamport time to be the maximum of the client's Lamport time and the server's current Lamport time plus one.

    sendMessage(Message message)

    This method takes a Message object as input and returns a string. It updates the message's Lamport time with the server's Lamport time, adds the message to the server's message list, and returns a confirmation string.


    CONTRIBUTION GUIDELINES :

    1. Clone the repository from GitHub.
    2. Create a new branch for your feature or bug fix.
    3. Implement your feature or bug fix.
    4. Commit your changes and push to your branch on the GitHub server.
    5. Submit a merge request to merge your changes into the main branch.

    LICENSE :

    This project is done part of coursework of CS4103 - Distributed Systems of the Computer Science Dept of University of St.Andrews.

    This project is licensed under the MIT License - see the LICENSE file for details.

message-passing-system-using-gwt's People

Contributors

thenameisajay avatar

Watchers

 avatar

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.