dist

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(pool string, caches ...*ecache.Cache) error

Bind - to enable distributed consistency `pool` is not necessary, it can be used to classify instances that store same items, but it will be more efficient if it is not empty `caches` is cache instances to be binded

func Init

func Init(r RedisCli)

Init `dist` component with redis client

func OnDel

func OnDel(pool, key string) error

OnDel - delete `key` in `pool` at distributed scale

Types

type RedisCli

type RedisCli interface {
	// if the redis client is ready
	OK() bool
	// pub a payload to channel
	Pub(channel, payload string) error
	// sub a payload from channel, callback uill tidy the local cache
	Sub(channel string, callback func(payload string)) error
}

`RedisCli“ interface used by `dist` component

Directories

Path Synopsis
v7

Jump to

Keyboard shortcuts

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