{"id":15566867,"url":"https://github.com/aswinbennyofficial/go-workerpool-webserver","last_synced_at":"2025-03-29T05:15:40.199Z","repository":{"id":218945694,"uuid":"747758770","full_name":"aswinbennyofficial/go-workerpool-webserver","owner":"aswinbennyofficial","description":"This repository contains a GoLang implementation of a web server that utilizes concurrent workers to handle resource heavy incoming requests.","archived":false,"fork":false,"pushed_at":"2024-01-24T16:18:38.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T14:50:14.228Z","etag":null,"topics":["go","golang","goroutine","goroutines","server","worker-threads"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aswinbennyofficial.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}},"created_at":"2024-01-24T15:30:33.000Z","updated_at":"2024-01-24T16:30:15.000Z","dependencies_parsed_at":"2024-01-24T17:07:33.825Z","dependency_job_id":null,"html_url":"https://github.com/aswinbennyofficial/go-workerpool-webserver","commit_stats":null,"previous_names":["aswinbennyofficial/go-workerpool-webserver"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinbennyofficial%2Fgo-workerpool-webserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinbennyofficial%2Fgo-workerpool-webserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinbennyofficial%2Fgo-workerpool-webserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aswinbennyofficial%2Fgo-workerpool-webserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aswinbennyofficial","download_url":"https://codeload.github.com/aswinbennyofficial/go-workerpool-webserver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246140591,"owners_count":20729802,"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":["go","golang","goroutine","goroutines","server","worker-threads"],"created_at":"2024-10-02T17:07:50.152Z","updated_at":"2025-03-29T05:15:40.177Z","avatar_url":"https://github.com/aswinbennyofficial.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Go Web Server with Concurrent Workers\n\n### Overview\nGo's implementation of web server already uses go routines on every request. So isn't it the best performance you can get ? Yes it is. But then what is the purpose of this project ?\n\nThis project provides a way for the web server to provide instant response but process the heavy work in the background using go routines. It is mostly useful, for resource heavy task to be done.\n\nThis repository contains a GoLang implementation of a web server that utilizes concurrent workers to handle incoming requests. The server responds to a \"/hello\" endpoint with an \"Accepted\" status code and the message \"Welcome.\"\n\n### Features\n\n1. Concurrent Workers: The server employs a pool of worker goroutines (goroutines are lightweight threads in Go) to handle incoming requests concurrently. The number of worker goroutines is defined by the workers variable.\n\n2. Request Handling: The \"/hello\" endpoint is defined in the handleHello function. When a request is received on this endpoint, the server responds with an \"Accepted\" status code and the message \"Welcome.\" Additionally, a timestamp (in nanoseconds) is sent to a channel (ch1) to be processed by one of the worker goroutines.\n\n3. Worker Functionality: The workerFxn function represents the behavior of the worker goroutines. Each worker waits for data from the ch1 channel, logs the received timestamp, and then simulates processing by sleeping for five seconds.\n\n\n### Usage\n\n1. Clone the repo \n```bash\ngit clone https://github.com/aswinbennyofficial/go-workerpool-webserver.git\n\n```\n```bash\ncd go-workerpool-webserver\n```\n\n2. Start the server \n```bash\ngo run ./server/\n```\n\n3. Run the client to test it\n```bash\ngo run ./client/\n```\nThe server will start in port 8080. Can test it also using `http://localhost:8080/hello`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faswinbennyofficial%2Fgo-workerpool-webserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faswinbennyofficial%2Fgo-workerpool-webserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faswinbennyofficial%2Fgo-workerpool-webserver/lists"}