Skip to content

c77cc/winsignal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Windows Signal For Go

Build Status

In the windows platform, your golang program can use winsignal to wait another process send signal.

Example


package main

import (
    "flag"
    "log"
    "github.com/c77cc/winsignal"
)

func ExampleWait() {
    stopptr := flag.Bool("stop", false, "stop program")
    flag.Parse()

    if *stopptr {
        // send signal in another process
        winsignal.Send(winsignal.SIGSTOP)
        return
    }

    // wait signal
    winsignal.Wait(winsignal.SIGSTOP, winsignal.SIGTERM)

    doSomethingWhenStop()
}

func doSomethingWhenStop() {
    log.Println("do something...")
}

Related Projects

About

Windows Signal For Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages