framechannel

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 4 Imported by: ? modules, 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 framechannel defines the transport-neutral byte channel consumed by suite-02 protocol sessions.

Index

Constants

View Source
const MaxFrameSize = 64 * 1024

Variables

View Source
var (
	ErrSendRejected = errors.New("frame channel rejected send before transport acceptance")
	ErrSendRetired  = errors.New("frame channel retired before transport acceptance")
)

Functions

func ClassifyDeadline

func ClassifyDeadline(channel any, cause error) error

func RejectSend

func RejectSend(cause error) error

RejectSend reports a local or caller-controlled rejection that either never reached transport ownership or was transactionally retracted before exposure. It is not evidence that the channel retired.

func RetireSend

func RetireSend(cause error) error

RetireSend reports that channel retirement won the transport admission race. Session owners may treat this exact disposition as natural lane completion; they must continue surfacing every accepted or unclassified delivery error.

func WithCapacityWait

func WithCapacityWait(channel any, cause error) error

WithCapacityWait is called only at a progress/deadline boundary, never for authentication, protocol, EOF or explicit cancellation failures.

Types

type BandwidthWaitError

type BandwidthWaitError struct {
	Cause      error
	RetryAfter time.Duration
}

func (*BandwidthWaitError) Error

func (err *BandwidthWaitError) Error() string

func (*BandwidthWaitError) Unwrap

func (err *BandwidthWaitError) Unwrap() error

type CapacityPressure

type CapacityPressure interface{ CapacityWait() time.Duration }

CapacityPressure is optional transport evidence. Its bounded lifetime and independent heartbeat preserve failure detection while recovery backs off.

type Channel

type Channel interface {
	Send(context.Context, Frame) error
	SendTerminal(context.Context, Frame) error
	Recv() <-chan Frame
	State() ChannelState
	Close() error
}

Channel exposes only ordered frame delivery and lifecycle. Relay, WebRTC, and in-memory tests implement it without importing session or content semantics.

type ChannelState

type ChannelState uint8
const (
	Connecting ChannelState = iota
	Open
	Closed
)

func (ChannelState) DiagnosticName

func (value ChannelState) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

type Frame

type Frame []byte

type SendDisposition

type SendDisposition uint8

SendDisposition describes whether a transport acquired ownership of a send before returning an error. Unclassified errors are deliberately treated as accepted: once ownership is uncertain, a protocol caller must not erase a potentially observed frame or retry it as though no transport saw it.

const (
	SendAccepted SendDisposition = iota + 1
	SendRejected
	SendRetired
)

func SendDispositionOf

func SendDispositionOf(err error) SendDisposition

SendDispositionOf returns the conservative ownership interpretation of err. A nil result means successful transport acceptance; a raw non-nil error is also accepted because the transport did not prove pre-acceptance rejection.

func (SendDisposition) DiagnosticName

func (value SendDisposition) DiagnosticName() string

DiagnosticName belongs to the source vocabulary; recorders accept new values.

Jump to

Keyboard shortcuts

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