{"id":22538437,"url":"https://github.com/shuttle/shuttle.core.threading","last_synced_at":"2025-04-09T20:22:53.539Z","repository":{"id":66349389,"uuid":"116029455","full_name":"Shuttle/Shuttle.Core.Threading","owner":"Shuttle","description":"Thread-based processing.","archived":false,"fork":false,"pushed_at":"2024-08-05T15:10:30.000Z","size":142,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-05T16:48:44.741Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shuttle.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":"2018-01-02T15:29:59.000Z","updated_at":"2024-08-05T15:09:51.000Z","dependencies_parsed_at":"2024-06-21T05:47:43.081Z","dependency_job_id":"3b7d4d30-c103-43b7-9462-3ea6e55d25c4","html_url":"https://github.com/Shuttle/Shuttle.Core.Threading","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Threading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Threading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Threading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shuttle%2FShuttle.Core.Threading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shuttle","download_url":"https://codeload.github.com/Shuttle/Shuttle.Core.Threading/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248104924,"owners_count":21048423,"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":[],"created_at":"2024-12-07T11:12:02.665Z","updated_at":"2025-04-09T20:22:53.521Z","avatar_url":"https://github.com/Shuttle.png","language":"C#","readme":"# Shuttle.Core.Threading\n\n```\nPM\u003e Install-Package Shuttle.Core.Threading\n```\n\nProvides various classes and interfaces to facilitate thread-based processing.\n\n## ProcessorThreadPool\n\n``` c#\npublic ProcessorThreadPool(\n    string name, \n    int threadCount, \n    IServiceScopeFactory serviceScopeFactory,\n    IProcessorFactory processorFactory, \n    ProcessorThreadOptions processorThreadOptions\n);\n```\n\nEach thread pool has a `name` used only for identyfing the pool.  The `threadCount` determines the number of `ProcessorThread` instances in the pool.  Each `ProcessorThread` calls the `IProcessor.ExecuteAsync(CancellationToken)` method on the instance provided by the `IProcessorFactory.Create()` method in a loop while the `CancellationToken.IsCancellationRequested` returns `false`.\n\nEvery call to `IProcessor.ExecuteAsync(ProcessorThreadContext, CancellationToken)` is wrapped in a `ProcessorThreadContext` instance that provides the `State` along with the `IServiceScope` instance created by the `IServiceScopeFactory.CreateScope()` method.\n\n## ProcessorThreadOptions\n\n| Option | Default | Description |\n| --- | --- | --- |\n| `JoinTimeout` | `00:00:15` | The duration to allow the processor thread to join the main thread. |\n| `IsBackground` | `true` | Indicates whether the thread will be started as a background thread.  Background threads are instantly killed when the host process stops. |\n| `Priority` | `ThreadPriority.Normal` | Indicates the [thread priority](https://docs.microsoft.com/en-us/dotnet/api/system.threading.thread.priority?view=net-6.0). |","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuttle%2Fshuttle.core.threading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshuttle%2Fshuttle.core.threading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshuttle%2Fshuttle.core.threading/lists"}