• v1.0.0 cc6edfe4c7

    Rene Nochebuena released this 2026-05-11 19:05:04 -06:00 | 1 commits to main since this release

    v1.0.0

    code.nochebuena.dev/go/launcher

    Overview

    launcher v1.0.0 commits the application lifecycle API as stable. All v0.9.0
    roadmap items are validated in production. The module ships a three-phase
    lifecycle manager (OnInitBeforeStartOnStart → reverse-order OnStop)
    with idempotent programmatic shutdown and per-component stop timeouts.

    What Changed Since v0.9.0

    No API changes. logz dependency bumped from v0.9.0 to v1.0.0.

    Roadmap items resolved

    Item Resolution
    Parallel OnInit No — registration order is the dependency contract; parallel init would require explicit dep graph
    Reverse-order shutdown validation Validated under production load with HTTP drain + DB close ordering
    Global shutdown deadline option No — Shutdown(ctx) already accepts a context with deadline; per-component timeout is sufficient
    OnStop behavior without OnStart Documented — OnStop is always called if OnInit succeeded, regardless of whether OnStart ran
    Shutdown idempotency validation Validated — sync.Once channel close is safe under concurrent signal + programmatic teardown

    Full API (stable)

    ComponentOnInit() error, OnStart() error, OnStop() error.

    Hookfunc() error; registered via BeforeStart.

    OptionsComponentStopTimeout time.Duration (zero → 15 seconds).

    LauncherAppend(components ...Component), BeforeStart(hooks ...Hook),
    Run() error, Shutdown(ctx context.Context) error.

    New(logger logz.Logger, opts ...Options) Launcher — constructor. No global state.

    Migration from v0.9.0

    No breaking changes. Only the logz indirect dependency version changes.

    go get code.nochebuena.dev/go/launcher@v1.0.0
    
    Downloads