Skip to content

Golang package to ensure, that only one instance of a program is running

Notifications You must be signed in to change notification settings

RumbleMonkey/single

 
 

Repository files navigation

single

single provides a mechanism to ensure, that only one instance of a program is running.

package main

import (
    "log"
    "time"

    "github.com/marcsauter/single"
)

func main() {
    s := single.New("name")
    s.Lock()
    defer s.Unlock()
    log.Println("working")
    time.Sleep(60 * time.Second)
    log.Println("finished")
}

The package currently supports linux, solaris and windows.

About

Golang package to ensure, that only one instance of a program is running

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%