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 ¶
const CheckParentInterval = time.Second * 1
The recomment interval to check the parent pid.
const Interval = CheckParentInterval
Variables ¶
This section is empty.
Functions ¶
func Watch ¶
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 ¶
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.