| 1 |
Source: golang-github-joshuarubin-lifecycle |
| 2 |
Section: golang |
| 3 |
Priority: optional |
| 4 |
Maintainer: Debian Go Packaging Team <[email protected]> |
| 5 |
Uploaders: Maytham Alsudany <[email protected]> |
| 6 |
Rules-Requires-Root: no |
| 7 |
Build-Depends: |
| 8 |
debhelper-compat (= 13), |
| 9 |
dh-golang, |
| 10 |
golang-any, |
| 11 |
golang-golang-x-sync-dev, |
| 12 |
Testsuite: autopkgtest-pkg-go |
| 13 |
Standards-Version: 4.6.2 |
| 14 |
Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-github-joshuarubin-lifecycle |
| 15 |
Vcs-Git: https://salsa.debian.org/go-team/packages/golang-github-joshuarubin-lifecycle.git |
| 16 |
Homepage: https://github.com/joshuarubin/lifecycle |
| 17 |
XS-Go-Import-Path: github.com/joshuarubin/lifecycle |
| 18 |
|
| 19 |
|
| 20 |
Package: golang-github-joshuarubin-lifecycle-dev |
| 21 |
Architecture: all |
| 22 |
Multi-Arch: foreign |
| 23 |
Depends: |
| 24 |
golang-golang-x-sync-dev, |
| 25 |
${misc:Depends}, |
| 26 |
Description: manage goroutines in golang applications (library) |
| 27 |
lifecycle helps manage goroutines at the application level. context.Context |
| 28 |
has been great for propagating cancellation signals, but not for getting any |
| 29 |
feedback about when goroutines actually finish. This package works with |
| 30 |
context.Context to ensure that applications don't quit before their goroutines |
| 31 |
do. |
| 32 |
. |
| 33 |
The semantics work similarly to the go (lifecycle.Go) and defer |
| 34 |
(lifecycle.Defer) keywords as well as sync.WaitGroup.Wait (lifecycle.Wait). |
| 35 |
Additionally, there are lifecycle.GoErr and lifecycle.DeferErr which only |
| 36 |
differ in that they take funcs that return errors. |
| 37 |
. |
| 38 |
lifecycle.Wait will block until one of the following happens: |
| 39 |
- all funcs registered with Go complete successfully then all funcs |
| 40 |
registered with Defer complete successfully |
| 41 |
- a func registered with Go returns an error, immediately canceling ctx and |
| 42 |
triggering Defer funcs to run. Once all Go and Defer funcs complete, Wait |
| 43 |
will return the error |
| 44 |
- a signal (by default SIGINT and SIGTERM, but configurable with |
| 45 |
WithSignals) is received, immediately canceling ctx and triggering Defer |
| 46 |
funcs to run. Once all Go and Defer funcs complete, Wait will return |
| 47 |
ErrSignal |
| 48 |
- a func registered with Go or Defer panics. the panic will be propagated to |
| 49 |
the goroutine that Wait runs in. there is no attempt, in case of a panic, |
| 50 |
to manage the state within the lifecycle package. |