pigsdklock

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pigsdklock coordinates readers and writers of staged Pig extension SDKs within one configuration root.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireBuild

func AcquireBuild(ctx context.Context, configRoot string) (func() error, error)

AcquireBuild holds a shared lease on one config root's staged SDKs.

func AcquireBuildForRoot

func AcquireBuildForRoot(ctx context.Context, sdkRoot string) (func() error, error)

AcquireBuildForRoot holds a shared lease when sdkRoot is a staged Pig SDK.

func AcquireStage

func AcquireStage(ctx context.Context, configRoot string) (func() error, error)

AcquireStage holds an exclusive lease on one config root's staged SDKs.

func SetWaitObserver

func SetWaitObserver(observer WaitObserver)

SetWaitObserver installs the process-wide observer of contended acquisitions, so a waiting startup can say why it is waiting. Nil removes it.

func WithBuild

func WithBuild[T any](ctx context.Context, configRoot string, fn func() (T, error)) (result T, err error)

WithBuild holds a shared lease while fn consumes one config root's SDKs.

func WithBuildCandidates

func WithBuildCandidates[T any](ctx context.Context, candidates []string, fn func() (T, error)) (result T, err error)

WithBuildCandidates holds shared leases for staged SDK paths before fn resolves one of them.

func WithBuildEntryCandidates

func WithBuildEntryCandidates(ctx context.Context, candidates []string, fn func() (string, bool, error)) (string, bool, error)

WithBuildEntryCandidates adapts a cache-entry lookup to WithBuildCandidates.

func WithBuildEntryForRoot

func WithBuildEntryForRoot(ctx context.Context, sdkRoot string, fn func() (string, bool, error)) (entry string, valid bool, err error)

WithBuildEntryForRoot holds a shared lease while fn selects a staged-SDK artifact.

func WithBuildForRoot

func WithBuildForRoot[T any](ctx context.Context, sdkRoot string, fn func() (T, error)) (result T, err error)

WithBuildForRoot holds a shared lease while fn consumes a staged SDK root.

Types

type WaitObserver

type WaitObserver func(lockPath string, shared bool) (done func())

WaitObserver is told when an acquisition must wait for another holder. It returns the function called when the wait ends, acquired or not.

Jump to

Keyboard shortcuts

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