consumerlife

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package consumerlife coordinates explicit consumer cancellation and native cleanup.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session permits one consuming loop and one concurrent, idempotent shutdown.

func (*Session) Begin

func (s *Session) Begin(ctx context.Context) (context.Context, func(), error)

Begin registers a cancelable consuming loop. Finish must be deferred after successful acquisition.

func (*Session) Shutdown

func (s *Session) Shutdown(ctx context.Context, cleanup func() error) error

Shutdown cancels and waits for the loop before native cleanup. On deadline, cleanup continues and later calls can await it.

Jump to

Keyboard shortcuts

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