startwindow

package
v0.10.0-alpha.33 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package startwindow coordinates the bounded parent-event relay used while a background managed tool reaches its Start boundary.

Index

Constants

This section is empty.

Variables

View Source
var ErrWindowClosed = errors.New("adk: background start event window is closed")

ErrWindowClosed is returned when a sender-backed start window has closed.

View Source
var ErrWindowTimeout = errors.New("adk: background start event window timed out")

ErrWindowTimeout is returned by Window.Wait when its positive timeout wins.

Functions

func Signal

func Signal(ctx context.Context)

Signal closes the start window in ctx, if present.

func TrySend

func TrySend(ctx context.Context, event any) (bool, error)

TrySend sends event through the open sender-backed window in ctx. The send is admitted atomically with the open check, but runs outside the window lock.

func WithSender

func WithSender(ctx context.Context, sender EventSender) context.Context

WithSender installs a parent event sender capability in ctx.

Types

type EventSender

type EventSender func(parentCtx context.Context, event any) error

EventSender emits one event through the parent execution context retained by an open start window.

type Window

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

Window represents one bounded explicit-background Start synchronization window. It retains the parent context only while the window is open.

func Open

func Open(parentCtx context.Context) (context.Context, *Window)

Open creates a Background-rooted context carrying one start window. Parent context values are not exposed through the returned background context.

func (*Window) Wait

func (w *Window) Wait(parentCtx context.Context, timeout time.Duration) error

Wait blocks until the start boundary is signaled, parentCtx is canceled, or timeout expires. A non-positive timeout disables the timer.

Jump to

Keyboard shortcuts

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