asprocess

package
v0.0.0-...-91b1b85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

The oryx asprocess package provides associated process, which fork by parent process and die when parent die, for example, BMS server use asprocess to transcode audio, resolve DNS, bridge protocol(redis, kafka e.g.), and so on.

Index

Constants

View Source
const CheckParentInterval = time.Second * 1

The recomment interval to check the parent pid.

View Source
const Interval = CheckParentInterval

Variables

This section is empty.

Functions

func Watch

func Watch(ctx ol.Context, interval time.Duration, callback Cleanup)

Watch the parent process, listen singals, quit when parent quit or signal quit. @remark optional ctx the logger context. nil to ignore. @reamrk check interval, user can use const CheckParentInterval @remark optional callback cleanup callback function. nil to ignore.

func WatchNoExit

func WatchNoExit(ctx ol.Context, interval time.Duration, quit chan<- bool)

Watch the parent process only, write to quit when parent changed. This is used for asprocess which need to control the quit workflow and signals. @remark quit should be make(chan bool, 1) to write quit signal, drop when write failed. @reamrk check interval, user can use const CheckParentInterval @remark user should never close the quit, or watcher will panic when write to closed chan.

Types

type Cleanup

type Cleanup func()

The cleanup function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL