# oklog/run

A universal mechanism to manage goroutine lifecycles

Repository: https://github.com/oklog/run
Canonical: https://ross.abutalabs.com/products/oklog-run
Language: Go
License: Apache-2.0
License Family: permissive
Last push: 2025-06-27T14:04:45+00:00

## Health v2 (maintenance only)
Score: 35/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 28, release rhythm 8, longevity 100
- inputs: {"age_days": 3215, "days_push": 432, "days_rel": 432, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1720, forks 92 (observed 2026-08-28T04:05:26.706261+00:00)

## What it is
run.Group is a small Go library providing a universal mechanism to manage goroutine lifecycles. Actors are added as execute/interrupt function pairs, and Run orchestrates concurrent execution with well-defined shutdown semantics.

## Use cases
- manage goroutine lifecycles in Go
- gracefully shut down an HTTP server on exit
- orchestrate multiple background workers as a unit
- run components in func main with clean teardown
- cancel goroutines via context when one exits

## When to choose
- you need coordinated startup and shutdown of multiple goroutines
- you want a smaller API than errgroup or tomb without context requirements
- you're wiring long-running services in a main function

## When to avoid
- you only need simple fire-and-forget goroutines
- you need staged shutdown semantics built in
- you're not writing Go

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, error-handling
- domain: developer-tools, backend
- platform: go, cross-platform
- tags: goroutines, lifecycle-management, graceful-shutdown

## Member repositories
- oklog/run (main) score 35

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:26.706261+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:34:05.310973+00:00, confidence not recorded.
  - readme: https://github.com/oklog/run (fetched 2026-08-28T04:05:26.706261+00:00, sha dc3fa461af23)
- Data as of 2026-08-30T08:39:29.467469+00:00.
