cacheContext

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cacheContext implements a context.Context wrapper which caches the results of Value calls, speeding up subsequent calls for the same key.

Context values are stored as immutable layers in a backwards-referenced list. Each lookup traverses the list from tail to head looking for a layer with the requested value. As a Context retains more values, this traversal will get more expensive. This class can be used for large Contexts to avoid repeatedly paying the cost of traversal for the same read-only value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

Wrap wraps the supplied Context in a caching Context. All Value lookups will be cached at this level, avoiding the expense of future Context traversals for that same key.

Types

This section is empty.

Source Files

  • context.go

Jump to

Keyboard shortcuts

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