{"id":15598578,"url":"https://github.com/ahmeddrawy/bully-algorithm-refactored","last_synced_at":"2025-10-04T21:48:05.985Z","repository":{"id":67654621,"uuid":"317965020","full_name":"ahmeddrawy/Bully-Algorithm-Refactored","owner":"ahmeddrawy","description":"simulating bully algorithm for distributed computing, using java socket programming and peer to peer architecture ","archived":false,"fork":false,"pushed_at":"2021-03-22T16:08:02.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T07:36:38.607Z","etag":null,"topics":["distributed-computing","peer-to-peer","socket-programming"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmeddrawy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-02T19:10:06.000Z","updated_at":"2023-11-03T10:07:08.000Z","dependencies_parsed_at":"2023-02-28T18:46:21.749Z","dependency_job_id":null,"html_url":"https://github.com/ahmeddrawy/Bully-Algorithm-Refactored","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"6a78300866dbcab0ad6fa384f5633ccf900a9d19"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmeddrawy%2FBully-Algorithm-Refactored","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmeddrawy%2FBully-Algorithm-Refactored/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmeddrawy%2FBully-Algorithm-Refactored/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmeddrawy%2FBully-Algorithm-Refactored/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmeddrawy","download_url":"https://codeload.github.com/ahmeddrawy/Bully-Algorithm-Refactored/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571637,"owners_count":21126520,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distributed-computing","peer-to-peer","socket-programming"],"created_at":"2024-10-03T01:40:41.135Z","updated_at":"2025-10-04T21:48:00.940Z","avatar_url":"https://github.com/ahmeddrawy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bully Algorithm\nThis is my implementation for [Bully Algorithm](https://en.wikipedia.org/wiki/Bully_algorithm) used in **Distributed computing**\n### Brief Description\nUsing peer to peer architecture and java socket programming, Simulating bully algorithm using interprocess communication without using threads or interprocess communication libraries\n\nMultiple instances of your application should run (different processes) and communicate with each other\n\n\n### Built using Peer to Peer Architecture\n#### New Process enters the system \n1. check if there's no coordinator in coordinator port\n   1. if there's no coordinator, then current process declares that it's the coordinator\n2. if there's a coordinator, process sends a message declaring itself,\n3. Coordinator assigns the new Process a port to listen to\n4. Coordinator sends a list of alive processes in system to the new process\n5. Coordinator sends the new process port to the other processes in system\n\n####  Coordinator fails\n Coordinator sends an alive message for all alive processes each period of time, if any process found that a coordinator failed  sends an election message to other processes\n\n#### Winning the Elections\nEventually the process with the highest priority - port in our case - wins an election.\nThe winning process will notify all the other running processes that it is the coordinator.\n\n\n### Main Classes\n1.Peer\n   1. Bind process to the specified port\n   2. send and receive messages \n\n2.Process\n   1. Has a peer to send and receive messages\n   2. Decode messages to take actions based on bully algorithms, previously explained\n   3. Notify other processes\n   4. Has list of peers of other processes in systems to interact with \n   \n3.Message\n   1. a utility class to encapsulate message details\n   2. Has an enum for message type\n### Built with\n- Java socket programming\n\n#### Author\n- [ahmeddrawy](https://github.com/ahmeddrawy)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmeddrawy%2Fbully-algorithm-refactored","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmeddrawy%2Fbully-algorithm-refactored","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmeddrawy%2Fbully-algorithm-refactored/lists"}