{"id":25440218,"url":"https://github.com/fkucukkara/backgroundjobs101","last_synced_at":"2025-05-15T13:34:18.792Z","repository":{"id":276616374,"uuid":"929788650","full_name":"fkucukkara/backgroundjobs101","owner":"fkucukkara","description":"This project demonstrates the usage of different types of hosted services in an ASP.NET Core application","archived":false,"fork":false,"pushed_at":"2025-05-01T10:12:28.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-01T11:20:05.084Z","etag":null,"topics":["background-jobs","netcore","webapi-core"],"latest_commit_sha":null,"homepage":"","language":"C#","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/fkucukkara.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":"2025-02-09T12:07:56.000Z","updated_at":"2025-05-01T10:12:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"03772e61-40c4-473e-861d-6bb894f202bf","html_url":"https://github.com/fkucukkara/backgroundjobs101","commit_stats":null,"previous_names":["fkucukkara/backgroundjobs101"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2Fbackgroundjobs101","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2Fbackgroundjobs101/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2Fbackgroundjobs101/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fkucukkara%2Fbackgroundjobs101/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fkucukkara","download_url":"https://codeload.github.com/fkucukkara/backgroundjobs101/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254349523,"owners_count":22056367,"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":["background-jobs","netcore","webapi-core"],"created_at":"2025-02-17T11:29:56.408Z","updated_at":"2025-05-15T13:34:18.782Z","avatar_url":"https://github.com/fkucukkara.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BackgroundJobs101\n\nThis project demonstrates the usage of different types of hosted services in an ASP.NET Core application. It includes examples of timed hosted services, scoped processing services, and queue processing using channels.\n\n## Project Structure\n\n- **API/Program.cs**: Configures the web application and registers the hosted services.\n- **API/BackgroundProcessors/HostedService.cs**: A timed hosted service that logs a message at regular intervals.\n- **API/BackgroundProcessors/ScopedProcessingService.cs**: A scoped processing service that performs work in a loop until cancellation.\n- **API/BackgroundProcessors/ConsumeScopedServiceHostedService.cs**: A background service that consumes the scoped processing service.\n- **API/BackgroundProcessors/QueueProcessor.cs**: A background service that processes messages from a channel.\n\n## How to Run\n\n1. Clone the repository:\n    ```sh\n    git clone https://github.com/fkucukkara/backgroundjobs101.git\n    cd src\\API\n    ```\n\n2. Build and run the application:\n    ```sh\n    dotnet build\n    dotnet run\n    ```\n\n3. Use the following endpoint to push messages to the queue:\n    ```sh\n    GET /push\n    ```\n\n## Services\n\n### HostedService\n\nA simple timed hosted service that logs a message every 5 seconds.\n\n### ScopedProcessingService\n\nA scoped service that performs work in a loop until the cancellation token is triggered.\n\n### ConsumeScopedServiceHostedService\n\nA background service that creates a scope and consumes the `ScopedProcessingService`.\n\n### QueueProcessor\n\nA background service that reads messages from a channel and processes them.\n\n## License\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis project is licensed under the MIT License, which allows you to freely use, modify, and distribute the code. See the [`LICENSE`](LICENSE) file for full details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffkucukkara%2Fbackgroundjobs101","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffkucukkara%2Fbackgroundjobs101","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffkucukkara%2Fbackgroundjobs101/lists"}