scheduler

package
v0.0.33 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: AGPL-3.0, AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package scheduler implements the Katzenpost server scheduler.

Index

Constants

View Source
const InboundPacketsChannelSize = 1000

Variables

This section is empty.

Functions

func New

func New(glue glue.Glue) (glue.Scheduler, error)

New constructs a new scheduler instance.

Types

type BatchingChannel added in v0.0.33

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

BatchingChannel implements the Channel interface, with the change that instead of producing individual elements on Out(), it batches together the entire internal buffer each time. Trying to construct an unbuffered batching channel will panic, that configuration is not supported (and provides no benefit over an unbuffered NativeChannel).

func NewBatchingChannel added in v0.0.33

func NewBatchingChannel(size BufferCap) *BatchingChannel

func (*BatchingChannel) Cap added in v0.0.33

func (ch *BatchingChannel) Cap() BufferCap

func (*BatchingChannel) Close added in v0.0.33

func (ch *BatchingChannel) Close()

func (*BatchingChannel) In added in v0.0.33

func (ch *BatchingChannel) In() chan<- interface{}

func (*BatchingChannel) Len added in v0.0.33

func (ch *BatchingChannel) Len() int

func (*BatchingChannel) Out added in v0.0.33

func (ch *BatchingChannel) Out() <-chan interface{}

Out returns a <-chan interface{} in order that BatchingChannel conforms to the standard Channel interface provided by this package, however each output value is guaranteed to be of type []interface{} - a slice collecting the most recent batch of values sent on the In channel. The slice is guaranteed to not be empty or nil. In practice the net result is that you need an additional type assertion to access the underlying values.

type BufferCap added in v0.0.33

type BufferCap int

BufferCap represents the capacity of the buffer backing a channel. Valid values consist of all positive integers, as well as the special values below.

const (
	// None is the capacity for channels that have no buffer at all.
	None BufferCap = 0
	// Infinity is the capacity for channels with no limit on their buffer size.
	Infinity BufferCap = -1
)

Jump to

Keyboard shortcuts

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