kcache

package
v0.0.0-...-3270118 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WatchFile

func WatchFile(cacheIdent *CacheIdent, events chan *ConcCacheEvent)

Types

type CacheIdent

type CacheIdent struct {
	CorpusID      string
	CacheKey      string
	CacheFilePath string
}

CacheIdent provides complete information about concordance cache record. In KonText, cache file path is typically derived from other two values but here we treat it as an independent item.

type ConcCacheEvent

type ConcCacheEvent struct {
	CorpusID string

	CacheKey string

	Record *taskdb.CacheRecord

	Error error
}

ConcCacheEvent contains status data related to a specific concordance calculation.

func (*ConcCacheEvent) ARF

func (c *ConcCacheEvent) ARF() float32

ARF returns so called Average Reduced Frequency. This value is typically available once the calculation is done (i.e. it comes with last update event)

func (*ConcCacheEvent) ConcSize

func (c *ConcCacheEvent) ConcSize() int

ConcSize returns current conconrdance size

func (*ConcCacheEvent) Finished

func (c *ConcCacheEvent) Finished() bool

Finished returns calc. status ("true" means "finished")

func (*ConcCacheEvent) FullSize

func (c *ConcCacheEvent) FullSize() int

FullSize - this value has no clear use in KonText but we keep it passing around.

func (*ConcCacheEvent) RelConcSize

func (c *ConcCacheEvent) RelConcSize() float32

RelConcSize returns a relative concordance size scaled to million tokens (aka "i.p.m")

func (*ConcCacheEvent) String

func (c *ConcCacheEvent) String() string

type RedisWatchdogFactory

type RedisWatchdogFactory struct {
	// contains filtered or unexported fields
}

func NewRedisWatchdogFactory

func NewRedisWatchdogFactory(cacheDB *taskdb.ConcCacheDB) *RedisWatchdogFactory

func (*RedisWatchdogFactory) Create

func (rwf *RedisWatchdogFactory) Create(cacheIdent *CacheIdent, events chan *ConcCacheEvent) *Watchdog

type Watchdog

type Watchdog struct {
	// contains filtered or unexported fields
}

func (*Watchdog) Start

func (w *Watchdog) Start()

Start initializes the process where the watchdog looks in regular intervals for a specific cache key and sends the data via 'events' channel.

func (*Watchdog) Stop

func (w *Watchdog) Stop()

Jump to

Keyboard shortcuts

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