{"id":24557630,"url":"https://github.com/yortw/yort.deadmanswitch","last_synced_at":"2026-02-02T19:35:36.429Z","repository":{"id":70831174,"uuid":"102054167","full_name":"Yortw/Yort.DeadManSwitch","owner":"Yortw","description":"A reusable implementation of a dead man switch. A dead man switch 'activates' (causes something to happen) when some event hasn't occurred for a specified period of time. It is effectively a resetable timer.","archived":false,"fork":false,"pushed_at":"2024-11-07T07:16:57.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-17T11:54:34.773Z","etag":null,"topics":["deadmanswitch","net40","netstandard20","switch","timer"],"latest_commit_sha":null,"homepage":"https://yortw.github.io/Yort.DeadManSwitch/","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/Yortw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-08-31T23:31:36.000Z","updated_at":"2024-11-07T07:14:59.000Z","dependencies_parsed_at":"2025-01-23T05:28:46.805Z","dependency_job_id":null,"html_url":"https://github.com/Yortw/Yort.DeadManSwitch","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yortw%2FYort.DeadManSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yortw%2FYort.DeadManSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yortw%2FYort.DeadManSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yortw%2FYort.DeadManSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yortw","download_url":"https://codeload.github.com/Yortw/Yort.DeadManSwitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249543296,"owners_count":21288703,"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":["deadmanswitch","net40","netstandard20","switch","timer"],"created_at":"2025-01-23T05:18:27.572Z","updated_at":"2026-02-02T19:35:36.374Z","avatar_url":"https://github.com/Yortw.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yort.DeadManSwitch\n\n## What is it?\nA reusable implementation of a dead man switch. A dead man switch 'activates' (causes something to happen) when some event hasn't occurred for a specified period of time. It is effectively a resetable timer.\n\n### When would I use it?\nAny time you want to take some action because something else hasn't happened for a while, this includes but is not limited to;\n\n* Logging or sending an alert when you haven't received a (network or other) message for X minutes/hours.\n* Performing a search x millseconds after the last key pressed in an auto-search/complete text field.\n* Starting archive/optimisation processes when there's been no user activity for a while.\n\n[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/Yortw/Yort.DeadManSwitch/blob/master/LICENSE) \n\n[![Build status](https://ci.appveyor.com/api/projects/status/orbrd1dkd2s40dm1?svg=true)](https://ci.appveyor.com/project/Yortw/yort-deadmanswitch)\n\n## Supported Platforms\nCurrently;\n\n* .Net Standard 1.2\n* .Net Standard 2.0 \n* .Net 4.0+\n\n## Available on Nuget\n\n```powershell\n    PM\u003e Install-Package Yort.DeadManSwitch\n```\n[![NuGet Badge](https://buildstats.info/nuget/Yort.DeadManSwitch)](https://www.nuget.org/packages/Yort.DeadManSwitch/)\n\n## How do I use it?\n\nCreate a switch passing the action to call when the switch activates, the delay before activation, and other settings to the constructor. Call the *Reset* method of the switch each time a regular event occurs. When *Reset* hasn't been called within the delay period specified, the switch will activate.\n\n*See the demo console app in the repo for sample usage*\n\n```c#\n    using Yort.DeadManSwitch;\n\n    //This switch activates after 5 seconds on inactivity, and automatically\n    //resets itself after activation.\n    var dms = new DeadManSwitch(5000, () =\u003e Console.WriteLine(\"Switch activated!\")), (reason) =\u003e Console.WriteLine(\"Reset because \" + reason.ToString()), true);\n\n    //Somewhere else in the code, in a code path that should execute regularly within 5 seconds\n    dms.Reset();\n\n    //To stop the switch, dispose it.\n    dms.Dispose();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyortw%2Fyort.deadmanswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyortw%2Fyort.deadmanswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyortw%2Fyort.deadmanswitch/lists"}