All Projects → heartwilltell → waitabit

heartwilltell / waitabit

Licence: MIT license
😴 A tiny library for handling system interrupts

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to waitabit

xbox360-controller-manager
Turn OFF your wireless xbox 360 controller on PC and see the battery status of the connected controllers.
Stars: ✭ 38 (+0%)
Mutual labels:  shutdown
ControlBlockService2
This is the driver for the ControlBlock re.v 2.X, a power switch and input/output/gameapd gadget for the Raspberry Pi
Stars: ✭ 18 (-52.63%)
Mutual labels:  shutdown
Qubes-scripts
Scripts that help with administration and usage of Qubes OS
Stars: ✭ 33 (-13.16%)
Mutual labels:  shutdown
fine
🧹 Gracefully shutdown Node.js application: help you handle exit signals and cleanup
Stars: ✭ 20 (-47.37%)
Mutual labels:  shutdown
busy
Busy is a mouse movement simulator. It stops your system from going to sleep / idling and makes sure that you keep getting those notifications while you take that well deserved break.
Stars: ✭ 15 (-60.53%)
Mutual labels:  shutdown
buddy-linux
Do you remember "Wubi Ubuntu Installer"? This project is both a replacement and an improvement of Wubi. You will be able to install your Debian (or derived) distribution on a PC without repartitioning it, simply by using a secondary/external boot device (like a USB drive).
Stars: ✭ 17 (-55.26%)
Mutual labels:  shutdown
node-graceful-shutdown
Gracefully shutdown your modular NodeJS application.
Stars: ✭ 20 (-47.37%)
Mutual labels:  shutdown
hiatus-spring-boot
No description or website provided.
Stars: ✭ 23 (-39.47%)
Mutual labels:  shutdown
Raspberry-Pi-Dashboard
Web-based dashboard interface to inspect Raspberry Pi hardware and software with no extra software required.
Stars: ✭ 131 (+244.74%)
Mutual labels:  shutdown

Wait a bit

Tiny library for manage you application shutdown in graceful way by catching the OS signals.

⚠️ This repository is now archived. Please use os/signal.NotifyContext instead

Documentation

Installation

go get -u github.com/heartwilltell/waitabit

Usage

package main

import (
    "log"
    "os"

    "github.com/heartwilltell/waitabit"
)


func main() { 
	
    // call your application here ...
    
    wait := waitabit.NewWait(os.Interrupt)
    wait.WaitWithFunc(func() {
        log.Println("Bye")
    })
    
    // or ...
    
    waitabit.NewWait(os.Interrupt).WaitWithFunc(func() {
    	log.Println("Bye")
    })
    
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].