SiddiqSoft.DaemonLockfile 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SiddiqSoft.DaemonLockfile --version 1.1.0                
NuGet\Install-Package SiddiqSoft.DaemonLockfile -Version 1.1.0                
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.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SiddiqSoft.DaemonLockfile --version 1.1.0                
#r "nuget: SiddiqSoft.DaemonLockfile, 1.1.0"                
#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.1.0

// Install SiddiqSoft.DaemonLockfile as a Cake Tool
#tool nuget:?package=SiddiqSoft.DaemonLockfile&version=1.1.0                

DaemonLockfile : A simple lockfile implementation for modern C++

CodeQL Build Status alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 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