candidatewriter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 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 candidatewriter isolates ordered ICE signaling I/O from peer lifecycle dispatch. An established transport must not wait for spare paths to be advertised.

Index

Constants

This section is empty.

Variables

View Source
var ErrLimit = errors.New("candidate writer: attempt candidate limit exceeded")

Functions

This section is empty.

Types

type Result

type Result struct {
	Delivered bool
	Err       error
}

type Send

type Send func(context.Context, []byte) (bool, error)

type Writer

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

Writer has one owning event loop. Enqueue, Stop and Close are called by that owner; only the worker invokes Send. The lifetime quota bounds both queued bodies and undrained results, even when signaling never makes progress.

func New

func New(ctx context.Context, maximum int, send Send) *Writer

func (*Writer) Close

func (writer *Writer) Close()

func (*Writer) Enqueue

func (writer *Writer) Enqueue(body []byte) error

func (*Writer) Results

func (writer *Writer) Results() <-chan Result

func (*Writer) Stop

func (writer *Writer) Stop()

Jump to

Keyboard shortcuts

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