discovery

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package discovery coordinates read-only inspector work on an owner event loop Start uses a bounded executor supplied by the caller; Complete and Expire run on the loop. Cancellation never affects a separately scheduled command

Index

Constants

View Source
const MaxPending = 32
View Source
const MaxResponseBytes = 256 << 10
View Source
const MaxTime int64 = 9007199254740991

Variables

This section is empty.

Functions

This section is empty.

Types

type Reply

type Reply struct {
	Context, Action string
	Payload         map[string]any
}

func Envelope

func Envelope(request Request, payload map[string]any, failure string) (Reply, error)

Envelope overwrites correlation fields and rejects oversized/non-JSON payloads Errors contain fixed public messages; raw worker errors are never exposed

type Request

type Request struct {
	Context, Action, Channel, ID, Operation, Scope string
}

type Runner

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

func (*Runner) Cancel

func (r *Runner) Cancel(context, channel, id string) bool

Cancel only the matching context, channel and request ID

func (*Runner) Clear

func (r *Runner) Clear(context string)

Cancel all discovery tickets owned by one context

func (*Runner) Close

func (r *Runner) Close()

Cancel all pending discovery tickets

func (*Runner) Complete

func (r *Runner) Complete(t *Ticket, payload map[string]any, failure string, now int64) (*Reply, error)

Complete a current ticket and ignore stale results

func (*Runner) Expire

func (r *Runner) Expire(now int64) ([]Reply, error)

Retire overdue tickets and produce timeout replies

func (*Runner) NextDeadline

func (r *Runner) NextDeadline() int64

Return the earliest pending discovery deadline

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, e *authoring.Engine, c *sdk.Client, request Request, timeout time.Duration, work func(context.Context) (map[string]any, error)) error

Run connects the coordinator to the SDK's bounded observation executor. It preserves command receipts and isolates jobs by inspector context and channel

func (*Runner) Start

func (r *Runner) Start(ctx context.Context, request Request, now, timeout int64) (*Ticket, error)

Admit or replace a discovery request within its deadline

type Ticket

type Ticket struct {
	Request  Request
	Deadline int64
	Context  context.Context
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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