tcache

package
v0.0.100 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache[V any] struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache[V any]() *Cache[V]

func (*Cache[V]) Compute

func (c *Cache[V]) Compute(key string, produce func() (V, error)) (V, error)

type Deferred

type Deferred[V any] struct {
	// contains filtered or unexported fields
}

func NewDeferred

func NewDeferred[V any](action *tasks.ActionEvent, produce func(context.Context) (V, error)) *Deferred[V]

func (*Deferred[V]) Get

func (d *Deferred[V]) Get(ctx context.Context) (V, error)

Jump to

Keyboard shortcuts

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