preloader

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AccountsCached = prometheus.NewGauge(prometheus.GaugeOpts{
		Namespace: "plutos",
		Subsystem: "preloader",
		Name:      "accounts_cached",
		Help:      "number of accounts in memory at the moment",
	})
)
View Source
var ErrLoading = errors.New("account is fetching from bigchain. retry again")

Functions

This section is empty.

Types

type Preloader

type Preloader struct {
	sync.Mutex

	MaxTransactions int
	// contains filtered or unexported fields
}

Preloader preloads account last transactions when account is used for the first time of after reset

func New

func New(chain pt.Chain, settingsChain pt.SettingsChain, bigchain pt.BigChain) *Preloader

func (*Preloader) Preload

func (p *Preloader) Preload(ctx context.Context, accID pt.AccID) error

func (*Preloader) Reset

func (p *Preloader) Reset(ctx context.Context, accID pt.AccID)

Jump to

Keyboard shortcuts

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