Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ajaymahadeven/message-passing-system-using-gwt
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.
https://github.com/ajaymahadeven/message-passing-system-using-gwt
googlewebtoolkit gwt lamport-algorithm lamport-clock
Last synced: 10 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/ajaymahadeven/message-passing-system-using-gwt
- Owner: ajaymahadeven
- License: mit
- Created: 2023-03-07T19:48:26.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-14T22:23:27.000Z (almost 2 years ago)
- Last Synced: 2024-11-17T16:03:02.705Z (about 1 month ago)
- Topics: googlewebtoolkit, gwt, lamport-algorithm, lamport-clock
- Language: Java
- Homepage:
- Size: 39.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
- To integrate the files with suitable IDE's follow the
GWT_README
text file.
After doing so , you can either attach an ANT build script to the
source
folder (or) open
terminal in the folder location andant clean
to clean any residual build files adnant devmode
to run the program in developer mode.---
## Functionality :
#### Client Code
In the client code, each node maintains a local clock using the variable'lamportClock'
. 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 :
- Clone the repository from GitHub.
- Create a new branch for your feature or bug fix.
- Implement your feature or bug fix.
- Commit your changes and push to your branch on the GitHub server.
- 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.