{"id":22938433,"url":"https://github.com/jacraig/taskmaster","last_synced_at":"2025-07-30T14:41:22.052Z","repository":{"id":141486600,"uuid":"99866191","full_name":"JaCraig/TaskMaster","owner":"JaCraig","description":"TaskMaster is a library to help running tasks only after certain criteria is met.","archived":false,"fork":false,"pushed_at":"2025-07-17T06:19:49.000Z","size":27979,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-30T01:38:36.194Z","etag":null,"topics":["task-management","task-runner","task-scheduler"],"latest_commit_sha":null,"homepage":"https://jacraig.github.io/TaskMaster/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaCraig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-10T01:08:50.000Z","updated_at":"2025-07-22T05:49:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"f47ed481-3ca6-44af-841d-2b7e0050c640","html_url":"https://github.com/JaCraig/TaskMaster","commit_stats":null,"previous_names":[],"tags_count":190,"template":false,"template_full_name":null,"purl":"pkg:github/JaCraig/TaskMaster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FTaskMaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FTaskMaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FTaskMaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FTaskMaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaCraig","download_url":"https://codeload.github.com/JaCraig/TaskMaster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaCraig%2FTaskMaster/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267883880,"owners_count":24160235,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["task-management","task-runner","task-scheduler"],"created_at":"2024-12-14T12:17:56.368Z","updated_at":"2025-07-30T14:41:21.975Z","avatar_url":"https://github.com/JaCraig.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TaskMaster\n\n[![.NET Publish](https://github.com/JaCraig/TaskMaster/actions/workflows/dotnet-publish.yml/badge.svg)](https://github.com/JaCraig/TaskMaster/actions/workflows/dotnet-publish.yml)\n\nTaskMaster is a lightweight C# library that provides functionality for running tasks based on specific criteria. It simplifies the process of setting up and executing tasks in your application.\n\n## Basic Usage\n\nIn order to use TaskMaster, you must wire it up first by adding it to your ServiceCollection:\n\n```csharp\nserviceCollection.RegisterTaskMaster();\n```\n\nOr if you are using Canister, you can use the following code:\n\n```csharp\nserviceCollection.AddCanisterModules();\n```\n\nOnce it is configured, you can create a new instance of the TaskMaster service:\n\n```csharp\nvar Runner = services.GetService\u003cTaskMaster\u003e();\nRunner.Run(args);\n```\n\nThe TaskMaster class handles task discovery, prioritization, and execution. It also logs any errors it encounters using Serilog. If Serilog is not registered with Canister, a default empty logger will be used. However, if a logger is specified, events will be logged using the ILogger class.\n\n## Creating a Task\n\nCreating a task with TaskMaster is straightforward. Simply inherit from the `ITask` interface and implement its methods. Here's an example of a basic \"Hello World\" task:\n\n```csharp\n/// \u003csummary\u003e\n/// Basic hello world task\n/// \u003c/summary\u003e\npublic class HelloWorldTask : ITask\n{\n    public IFrequency[] Frequencies =\u003e new IFrequency[] { new RunAlways() };\n\n    public string Name =\u003e \"Hello World\";\n\n    public int Priority =\u003e 1;\n\n    public bool Execute(DateTime lastRun)\n    {\n        Console.WriteLine(\"Hello World\");\n        return true;\n    }\n\n    public bool Initialize(IDataManager dataManager)\n    {\n        return true;\n    }\n}\n```\n\nIn this example, the task runs every time the `Run` method of the TaskMaster is called. However, you can specify different frequencies for execution. The task's name is \"Hello World,\" which is used for logging purposes. The priority is set to 1, determining the execution order. Tasks with lower priority values are executed first, and tasks with the same priority may run in parallel.\n\nThe `Initialize` method is called when the task is created and receives an `IDataManager` instance, which handles saving and retrieving configuration data for the task. By default, the data manager saves configuration data as JSON-serialized strings, but you can implement your own data manager for customization.\n\nThe `Execute` method is where the actual work of the task should be performed.\n\n## Installation\n\nTaskMaster is available as a NuGet package. You can install it by running the following command in the Package Manager Console:\n\n```shell\nInstall-Package TaskMaster\n```\n\n## Build Process\n\nTo build the library, ensure you have the following minimum requirements:\n\n- Visual Studio 2022\n\nClone the project repository, and you should be able to load the solution in Visual Studio and build it without any issues.\n\nFor any further assistance or information, please refer to the project documentation or reach out to the project contributors.\n\nEnjoy using TaskMaster in your applications!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Ftaskmaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacraig%2Ftaskmaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacraig%2Ftaskmaster/lists"}