deployment

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 1 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 struct {
	// contains filtered or unexported fields
}

Cache is meant as an asynchronous KV memcache to reduce constant keeper queries. It is NOT threadsafe, it requires manual bootstrapping by loading data from the keeper once during initialisation and needs to be kept in sync with added and removed keeper data manually.

If this works well, I'd like to build this into a v2 that functions basically like a keeper wrapper, agnostic of the underlaying data and keeping in sync with added and removed items automatically.

func NewCache

func NewCache(bootstrap func(context.Context, *Cache)) *Cache

func (*Cache) Add

func (c *Cache) Add(ctx context.Context, chainReferenceID string, smartContractID uint64, msgIDs ...uint64)

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, chainReferenceID string, msgIDs ...uint64)

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, chainReferenceID string, msgID uint64) uint64

func (*Cache) Has

func (c *Cache) Has(ctx context.Context, chainReferenceID string, msgID uint64) bool

Jump to

Keyboard shortcuts

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