SiddiqSoft.DaemonLockfile
1.2.1-main0001
This is a prerelease version of SiddiqSoft.DaemonLockfile.
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 SiddiqSoft.DaemonLockfile --version 1.2.1-main0001
NuGet\Install-Package SiddiqSoft.DaemonLockfile -Version 1.2.1-main0001
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="SiddiqSoft.DaemonLockfile" Version="1.2.1-main0001" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.DaemonLockfile --version 1.2.1-main0001
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SiddiqSoft.DaemonLockfile, 1.2.1-main0001"
#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 SiddiqSoft.DaemonLockfile as a Cake Addin #addin nuget:?package=SiddiqSoft.DaemonLockfile&version=1.2.1-main0001&prerelease // Install SiddiqSoft.DaemonLockfile as a Cake Tool #tool nuget:?package=SiddiqSoft.DaemonLockfile&version=1.2.1-main0001&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
DaemonLockfile : A simple lockfile implementation for modern C++
Objective
Provide for daemons (applications running as services under docker as an example) to limit themselves to a single instance per "name".
Requirements
- C++20
- Useful for running "daemons" under docker where you may not always have or wish for a true service under the operating system.
Usage
- Use the nuget SiddiqSoft.DaemonLockfile
- You can also git submodule:
git submodule add https://github.com/SiddiqSoft/DaemonLockfile.git
- Copy paste..whatever works.
Example (when using nuget to add the header in the solution)
#include "siddiqsoft/DaemonLockfile.hpp"
// Example daemon host structure
struct MyDaemonType
{
siddiqsoft::DaemonLockfile myLockfile{"MyDaemonType", true}; //force acquire
..
..
};
// The "daemon" will hold the lock and when the application exits the lock will be released.
static MyDaemonType daemon;
int main(int argc, char *argv[])
{
// Bailout immediately if we do not have a lock--this implies some other instance is running
if(!daemon.myLockfile.isLocked) return 1;
..
..
// We have the exclusice lock
}
Roadmap
<small align="right">
© 2021 Siddiq Software LLC. All rights reserved.
</small>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
native | native is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has 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.2.2 | 478 | 7/22/2021 |
1.2.1-main0001 | 319 | 7/22/2021 |
1.2.0 | 461 | 7/15/2021 |
1.1.0 | 356 | 7/15/2021 |