SelfKeeper 1.0.0-beta-001
This is a prerelease version of SelfKeeper.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SelfKeeper --version 1.0.0-beta-001
NuGet\Install-Package SelfKeeper -Version 1.0.0-beta-001
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SelfKeeper" Version="1.0.0-beta-001" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SelfKeeper --version 1.0.0-beta-001
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SelfKeeper, 1.0.0-beta-001"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SelfKeeper as a Cake Addin #addin nuget:?package=SelfKeeper&version=1.0.0-beta-001&prerelease // Install SelfKeeper as a Cake Tool #tool nuget:?package=SelfKeeper&version=1.0.0-beta-001&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SelfKeeper
1. Intro
A library that lets applications run as their own watchdog.
允许应用程序作为自己的看门狗运行的库。
- 支持部分信号传递到子进程,可以在某些情况下执行优雅关闭;
- 原始的控制台输出颜色会被保留;
1. 如何使用
1.1 安装Nuget
包
dotnet add package SelfKeeper --prerelease
1.2 启用SelfKeeper
在程序入口处添加处理代码
KeepSelf.Handle(args);
或进行更多配置
KeepSelf.Handle(args, options =>
{
options.RemoveFlag(KeepSelfFeatureFlag.SkipWhenDebuggerAttached | KeepSelfFeatureFlag.DisableForceKillByHost); //配置功能
options.StartFailRetryDelay = TimeSpan.FromSeconds(1); //配置启动失败的重试延时
options.RestartDelay = TimeSpan.FromSeconds(1); //进程退出后的重启延时
options.Logger = null; //配置日志记录器
});
- 主进程会在
KeepSelf.Handle
阻塞,启动并监控子进程; - 主进程在退出时会在
KeepSelf.Handle
内调用Environment.Exit
退出,不会执行后面的代码;
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.1 | 22,185 | 1/7/2024 |
1.1.0 | 28,090 | 2/4/2023 |
1.0.0 | 7,181 | 7/3/2022 |
1.0.0-beta-005 | 240 | 5/13/2022 |
1.0.0-beta-004 | 167 | 5/11/2022 |
1.0.0-beta-003 | 173 | 5/9/2022 |
1.0.0-beta-002 | 167 | 5/8/2022 |
1.0.0-beta-001 | 188 | 5/6/2022 |