async

package
v0.0.0-...-5a3b7a3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Load

type Load func(ctx context.Context) interface{}

type Loader

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

func NewLoader

func NewLoader(maxLoaded int) *Loader

func (*Loader) Frame

func (loader *Loader) Frame(gtx layout.Context, w layout.Widget) layout.Dimensions

func (*Loader) Run

func (loader *Loader) Run(ctx context.Context)

func (*Loader) Schedule

func (loader *Loader) Schedule(tag Tag, load Load) Resource

func (*Loader) Stats

func (loader *Loader) Stats() LoaderStats

func (*Loader) Updated

func (loader *Loader) Updated() <-chan struct{}

type LoaderStats

type LoaderStats struct {
	Lookup int
	Queued int
}

type Resource

type Resource struct {
	State State
	Value interface{}
}

type State

type State byte
const (
	Queued State = iota
	Loading
	Loaded
)

type Tag

type Tag interface{}

Jump to

Keyboard shortcuts

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