completion

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package completion owns the bounded completion window of an admitted effect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lifetime

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

Lifetime keeps an admitted exchange alive for its caller's normal lifetime, then grants a bounded completion grace after the first cancellation. Copies share ownership of the context, cancellation callbacks and grace timer.

func New

func New(parent context.Context, grace time.Duration, cancellation ...context.Context) Lifetime

New preserves parent's values and observes its cancellation plus any extra owner lifetimes. No timer runs while every observed lifetime remains live. A caller deadline starts the grace when that deadline actually expires.

func (Lifetime) Close

func (l Lifetime) Close()

Close releases completion ownership and is safe through any copied handle.

func (Lifetime) Context

func (l Lifetime) Context() context.Context

Context is the exchange context. A zero Lifetime cannot authorize work.

Jump to

Keyboard shortcuts

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