organizer

package
v0.2.8-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(types.LayerID)

Callback is used to send iterated layers to the caller. For simplicity Callback iterates over all layers unconditionally.

type Opt

type Opt func(*Organizer)

Opt is for configuring Organizer.

func WithBufferSize

func WithBufferSize(size int) Opt

WithBufferSize configures size of the window. By default window of the size 1000 is used.

func WithLastLayer

func WithLastLayer(lid types.LayerID) Opt

WithLastLayer layer configures last layer that tortoise knows about.

func WithLogger

func WithLogger(logger log.Log) Opt

WithLogger configures logger for Organizer.

type Organizer

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

Organizer is a decorator for tortoise that keeps layers in order within the window and sends them to tortoise only when the window has no gaps.

func New

func New(opts ...Opt) *Organizer

New creates Organizer instance.

func (*Organizer) Iterate

func (o *Organizer) Iterate(ctx context.Context, lid types.LayerID, f Callback)

Iterate allows to iterate over all ordered layers that are currently within the window including new layer.

Jump to

Keyboard shortcuts

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